首页 > 编程语言 > 详细

使用postman模拟上传文件到springMVC的坑:the request was rejected because no multipart boundary was found

时间:2016-10-16 16:41:06      阅读:1347      评论:0      收藏:0      [点我收藏+]

标签:class   style   log   com   http   it   si   la   使用   

参考该文解决问题:http://blog.csdn.net/sanjay_f/article/details/47407063

 

报错

threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found] with root cause
org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found

技术分享

不手动添加content-type后就行了:此时访问成功。

技术分享

 

 

问题的原因

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.

src: 

http://stackoverflow.com/questions/17415084/multipart-data-post-using-Python-requests-no-multipart-boundary-was-found

简称。。制作多情。。。头部会自动加好,不要画足添蛇。。。。。。。。。

 

使用postman模拟上传文件到springMVC的坑:the request was rejected because no multipart boundary was found

标签:class   style   log   com   http   it   si   la   使用   

原文:http://www.cnblogs.com/ljdblog/p/5966675.html

(0)
(0)
   
举报
评论 一句话评论(0
© 2014 bubuko.com 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号