The request entity body has an incorrect value in the 'Content-Disposition' header. The expected format for this value is 'Content-Disposition:

后端 未结 1 589
庸人自扰
庸人自扰 2021-01-27 09:33

I have tried multiple HTTP APIs to post a file to OneDrive using the POST method, and I am getting always the same error.

I went to the extreme case of creating my own S

1条回答
  •  一向
    一向 (楼主)
    2021-01-27 10:37

    Try putting the Content-Disposition header as the first header after the boundary, followed by the 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 to omit the Content-Length as well to make it work. Pretty fragile really.

    0 讨论(0)
提交回复
热议问题