onedrive - The request entity body has an incorrect value in the 'Content-Disposition' header. The expected format for this value is 'Content-Disposition: -
onedrive - The request entity body has an incorrect value in the 'Content-Disposition' header. The expected format for this value is 'Content-Disposition: -
i have tried multiple http apis post file onedrive using post method, , getting same error.
i went extreme case of creating own ssl tcp socket , send next bytes:
post /v5.0/folder.a4fb14adbccd1917.a4fb14adbccd1917!32089/files http/1.1 accept-encoding: authorization: bearer ewciaq1dbaaugccxc8wu/zfu9qnldzxy%2bynelfkaaxa4ajqtmipoouadokv98madpbzp8sef0zjyzu4%2bva0fvr/awr4x0chwazef7s7hbeabbptxlwckheyrgkfbh2ybadpxeju0grroz37winvpsgfvd8bz9gtcqwdhh3guxunbm/nlqh1tizelmjyupegaebbwt25f8sokzizi2kpvlzdpokjjbq2bxrycawyddk74ivuiudgkx4hmpmwzmwtergeybpn2egobhqa8o3gt2a9ta2hps0elcv0gkhwg/u1t19/xjokw2dnbbsj01a9ijkmyxhamtyg71sgjqzhdxjajf0hxng8niioty82mlhqewcweyzfxosgddt0clkidzgaacedf3skfts5%2bwahgkglcwfj4drlrn3/f2dvozwgyeitjkwfzdx%2b4b8m5olyo5oykwf77zjvxnukj50ciovcjq/ognv1kmgb45eexy3%2b3t9jjn0rm91dognufgj1m/vuzvn3ep5f3jr0hmvxbmpzfbimv/c/5su5esbza1zas9xt%2bkei0rrivsqhs4qi4bps3rn5kpqd4yrnxctdi%2b9b9akuvqb%2bxew5lwgur5yvaaohhceprqnqt2my7c1zqmoa/c7e63fuoosdr0kpjbsdkl8axet9vt/6a8bk0mny%2b7mj1czafl%2bhvk0lfi4z6lja/3ayy%2bpt8%2boc8gnp1mu/1rcdot8k1pxwhnvuie8cnryi28lum%2bwucnurrcnmnborhzu64jxqoc1egoja6wncyi%2bw3tq1dordjwn91qenqaxxbmpl1lwdp548kdjcepwxi4skxqknvwcxw1vczy90shzruvnmb content-length: 197 content-type: multipart/form-data; boundary=8381f8b9-b470-43ce-b23b-f13cf5840014 host: apis.live.net connection: keep-alive cache-control: no-cache --8381f8b9-b470-43ce-b23b-f13cf5840014 content-length: 9 content-type: application/octet-stream; charset=utf-8 content-disposition: form-data; name="file"; filename="hello.txt" xxxxxxxxx --8381f8b9-b470-43ce-b23b-f13cf5840014--
and next bytes back:
http/1.1 400 bad request cache-control: private, no-cache, no-store, must-revalidate content-length: 276 content-type: application/json; charset=utf-8 server: live-api/18.105.8117.3007 microsoft-httpapi/2.0 p3p: cp="bus cur cono fin ivdo onl our phy samo telo" x-msnserver: by3301____pap073 x-content-type-options: nosniff x-http-live-request-id: api.f06af310-9b49-4cbf-bf71-8c9d79570ec9 x-asmversion: unknown; 18.105.0.0 date: mon, 06 oct 2014 21:37:15 gmt { "error": { "code": "request_body_invalid", "message": "the request entity body has wrong value in 'content-disposition' header. expected format value 'content-disposition: form-data; name=\"file\"; filename=\"[filename]\"'." } }
all of happened after tried reply this question.
any idea?
update: used onedrive-api
tag recommended in msdn forums.
try putting content-disposition header first header after boundary, followed content-type:
--8381f8b9-b470-43ce-b23b-f13cf5840014 content-disposition: form-data; name="file"; filename="hello.txt" content-type: application/octet-stream; charset=utf-8
you may need omit content-length create work. pretty fragile really.
onedrive onedrive-api
Comments
Post a Comment