0

I am making a multi part upload request to Google drive api in Objective c and this is my request parameter url:https://www.googleapis.com/upload/drive/v2/files?uploadType=multipart

{
    Authorization = "Bearer token here";
    "Content-Length" = 1259175;
    "Content-Type" = "multipart/related; boundary=1F538E72-A1C7-4D64-A90C-7286FADE6E92-4313-000022A3405EDE24";
}

i get the error response as follows with status code 400

{
    "Alternate-Protocol" = "443:quic,p=0.02";
    "Content-Length" = 44;
    "Content-Type" = "text/html; charset=UTF-8";
    Date = "Fri, 09 Jan 2015 14:35:35 GMT";
    Server = "UploadServer (\"Built on Dec 19 2014 10:24:45 (1419013485)\")";
}

And it reports

"Invalid multipart request with 0 mime parts." {NSLocalizedDescription=Invalid multipart request with 0 mime parts.}

Can anyone tell me why i am facing this issue.

Rob
  • 415,655
  • 72
  • 787
  • 1,044
iphone66
  • 134
  • 2
  • 10
  • You have not shared the body of your request, but it looks like the error message is suggesting that you didn't actually construct a valid multipart request. You've shared the header of your request, but not the body. Perhaps edit your question, showing us how you created the body of this multipart request. See http://stackoverflow.com/a/24252378/1271826 for example of how to create multipart request yourself (and perhaps, better, how to use something like AFNetworking to create such a request). – Rob Jan 09 '15 at 15:36
  • Update your question with your relevant code. – rmaddy Jan 09 '15 at 16:10
  • Thanks rob. I am able to create the upload but the file is named untitled and it does not go inside the specified folder. This is my Json body to add file metadata. body { metadata = "{\n \"title\" : \"IMG_0004.JPG\",\n \"parent\" : {\n \"id\" : \"0BwpC9cGlJDQKSGt3VHF5UHBOS0E\"\n }\n}"; } – iphone66 Jan 22 '15 at 09:28
  • @iphone66 Can you share your code to upload multipart image to drive? – Bhavin Ramani Apr 14 '17 at 04:13

0 Answers0