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 接收參數。不夠注意細節。
2.to be continue
。。。