Wednesday, April 15, 2015

Android : how to write andorid code for multipart http post



how to write the following in post body (android), multipart (https://github.com/OneDrive/onedrive-api-docs/blob/master/items/upload_post.md)



POST /drive/items/{folder-id}/children
Content-Type: multipart/related; boundary="A100x"

--A100x
Content-ID: <metadata>
Content-Type: application/json

{
"name": "newfile.txt",
"file": {},
"@content.sourceUrl": "cid:content",
"@name.conflictBehavior": "rename"
}

--A100x
Content-ID: <content>
Content-Type: text/plain

Contents of the file to be uploaded.

--A100x--

No comments:

Post a Comment