title: In Google Drive SDK, how to make a resumable upload?
body: <p>I tried to make a resumable upload without much success.</p>
  
  <p>I read the <a href="https://developers.google.com/drive/manage-uploads#resumable" rel="nofollow">https://developers.google.com/drive/manage-uploads#resumable</a> page but I can't figure out how to get this "Location" header in the response of the first request.</p>
  
  <p>The API documentation specify that we can make either a POST or a PUT on the first URL, but if I make a PUT, I get a 404, and if I make a POST I get a new file created with no content and no Location header in the response.</p>
  
  <p>Here is my POST query (with a PUT and exactly the same query it returns a 404):</p>
  
  <pre><code>POST https://www.googleapis.com/drive/v2/files?uploadType=resumable
  Accept = application/json
  Authorization = Bearer xxxxxxxxx
  Content-Length = 71
  Content-Type = application/json
  X-Upload-Content-Length = 10
  X-Upload-Content-Type = text/plain
  
  {
      mimeType = "text/plain";
      parents =     (
                  {
              id = root;
          }
      );
      title = "test.txt";
  }
  </code></pre>
  
  <p>and the response:</p>
  
  <pre><code>"Cache-Control" = "no-cache, no-store, max-age=0, must-revalidate";
  "Content-Type" = "application/json; charset=UTF-8";
  Date = "Wed, 29 Aug 2012 09:53:15 GMT";
  Etag = "\"UlXjrWs5BKksMni8RDMKhlFkHGQ/MTM0NjIzMzk5NTA2MQ\"";
  Expires = "Fri, 01 Jan 1990 00:00:00 GMT";
  Pragma = "no-cache";
  Server = GSE;
  "Transfer-Encoding" = Identity;
  "X-Content-Type-Options" = nosniff;
  "X-Frame-Options" = SAMEORIGIN;
  "X-XSS-Protection" = "1; mode=block";
  
  {
   "kind": "drive#file",
   "id": "xxxx",
   "etag": "\"xxxx\"",
   "selfLink": "https://xxxx",
   "webContentLink": "https://xxxx",
   "alternateLink": "https://xxxx",
   "title": "test.txt",
   "mimeType": "text/plain",
   "labels": {
    "starred": false,
    "hidden": false,
    "trashed": false,
    "restricted": false,
    "viewed": true
  },
  "createdDate": "2012-08-29T09:53:15.200Z",
  "modifiedDate": "2012-08-29T09:53:15.061Z",
  "modifiedByMeDate": "2012-08-29T09:53:15.061Z",
  "lastViewedByMeDate": "2012-08-29T09:53:15.061Z",
  "parents": [
  {
   "kind": "drive#parentReference",
   "id": "xxxx",
   "selfLink": "https://xxxx",
   "parentLink": "https://xxxx",
   "isRoot": true
  }
  ],
  "downloadUrl": "https://xxxx",
  "userPermission": {
    "kind": "drive#permission",
    "etag": "\"xxxx\"",
    "id": "me",
    "selfLink": "https://xxxx",
    "role": "owner",
    "type": "user"
  },
  "originalFilename": "test.txt",
  "fileExtension": "txt",
  "md5Checksum": "xxxx",
  "fileSize": "0",
  "quotaBytesUsed": "0",
  "ownerNames": [
  "xxxx"
  ],
  "lastModifyingUserName": "xxxx",
  "editable": true,
  "writersCanShare": true
  }
  </code></pre>