今天在用postman发请求时,以Json的形式发送一个POJO参数,结果一直报错:WARNING] Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json' not supported],如下图所示:
经过检查各方面都没有问题,最发现是在SpringMVC配置类中没有加 @EnableWebMvc 的原因,开启由json数据转换为实体类对象的功能必须加此注释!
- application supported Content 39 typeapplication supported content 39 commonresult content-type application converter content-type application content type 39 multipartencoder content-type multipart 数组content-type application content content-type x-content-type-options django-content-type 160 supported content charset content-type content http type