美文网首页橙小张的Java后端学习之路
文件上传遇到no multipart boundary was

文件上传遇到no multipart boundary was

作者: 橙小张 | 来源:发表于2017-07-31 19:36 被阅读77次

    先补点基础知识: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就好了

    参考博客:http://blog.csdn.net/shootyou/article/details/7182004

    • HTTP的一些知识点也是很重要的,借此机会,占个坑,之后补

    相关文章

      网友评论

        本文标题:文件上传遇到no multipart boundary was

        本文链接:https://www.haomeiwen.com/subject/jfgrlxtx.html