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