参考该文解决问题: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

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

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

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

 

 

问题的原因

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

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

 

相关文章:

  • 2021-10-17
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2021-08-31
  • 2021-11-19
  • 2022-12-23
  • 2021-09-24
猜你喜欢
  • 2021-03-31
  • 2021-09-15
  • 2022-12-23
  • 2021-12-05
  • 2021-09-19
  • 2021-12-28
相关资源
相似解决方案