网上的解决办法非常多,但是大多不靠谱。

归结原因:SpringMVC 无法通过 httprequest headers 中的 Content-Type 和 Accept 匹配到对应的
HttpMessageConverter。

解决办法:修改 httprequest headers中的 Content-Type 和 Accept,让它和你的 SpringMVC 的
MessageConverters 中设置的 supportedMediaTypes 中的某一项匹配上就可以了。

POST JSON fails with 415 Unsupported media type, SpringMVC

POST JSON fails with 415 Unsupported media type, SpringMVC

 

 

POST JSON fails with 415 Unsupported media type, SpringMVC

 

 

 

 

 

 

POST JSON fails with 415 Unsupported media type, SpringMVC

相关文章: