先补点基础知识:https://imququ.com/post/four-ways-to-post-data-in-http.html
image.png
- boundary:边界
- 数据是以multipart/form-data来编码
- 以boundary开始
- 内容描述
- 回车
- 字段具体内容
- 如果是文件还要包含文件名和文件类型
- 以--boundary--结束
问题描述
image.png
image.png
image.png
image.png
- 解决方案:
You shouldNEVERset that header yourself. We set the header properly with the boundary. If you set that header, we won't and your server won't know what boundary to expect (since it is added to the header). Remove your custom Content-Type header and you'll be fine
,也就是取消自己设置Content-Type就好了