I am trying to follow the resumable media upload for google drive api from this link. https://developers.google.com/drive/manage-uploads#resumable
My first request goes through fine and I get back a second url in the Location header. However, when I make the second PUT call given in the documentation, it throws back a bad request.
Request 1:
POST https://www.googleapis.com/upload/drive/v2/files?uploadType=resumable
Request Header 1:
Content-Type: application/json
Authorization: Bearer ya..
X-Upload-Content-Type: text/plain
X-Upload-Content-Length: 112
Host: www.googleapis.com
Content-Length: 112
Body
{'title' : 'bravo122314.txt', 'mimeType': 'text/plain', 'parents' : [{'id': '0Bw5JasxEfsasa8NNsdU5dU123iVHc'}] }
Response Header 1:
Location: https://www.googleapis.com/upload/drive/v2/files?uploadType=resumable&upload_id=ASM
Date: Tue, 03 Dec 2013 21:07:40 GMT
Server: HTTP Upload Server Built on Nov 15 2013 16:02:54 (1384560174)
Content-Length: 0
Content-Type: text/html; charset=UTF-8
This is the following request
Request 2:
PUT https://www.googleapis.com/upload/drive/v2/files?uploadType=resumable&upload_id=ASM
Request Header 2:
Authorization: Bearer ya..
Content-Type: text/plain
Response 2:
{
"error":{
"errors":[
{
"domain":"global",
"reason":"badRequest",
"message":"Invalid Upload Request"
}
],
"code":400,
"message":"Invalid Upload Request"
}
}
Has anyone faced this issue before? Am I missing some header?