org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary;charset=UTF-8' not supported


1.Content type  not supported

雷电模拟器调试,后台断点调试时,fiddler捕获多次重复请求(都是未完成进行中的请求,常规的下载箭头),便准备用postman发送请求调式。遇到后台错误,postman接收到的响应结果为

{
    "code": "500",
    "msg": "服务器错误!"
}
 
后台异常为:
Content type 'multipart/form-data;boundary=--------------------------399451406379538159072279;charset=UTF-8' not supported
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=--------------------------399451406379538159072279;charset=UTF-8' not supported

 

取消掉postman请求header 中默认content-type配置

Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

 

度娘后说是

@RequestBody与 content type有冲突,无法识别是表单提交还是json提交

Content type ‘multipart/form-data;boundary=--------------------------9107

@RequestBody与Content-type

 

果真是 @RequestBody 接收参数。不够注意细节。

2.to be continue

。。。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM