首页 > 技术文章 > org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported或其他Content type不支持处理

shuiguo 2021-06-09 11:52 原文

Spring显示Content type 'application/json;charset=UTF-8' not supported

 

排查思路

 

1.是否在异步请求有如下设置

contentType:"application/json;charset=utf-8"

 

2.是否导入jackson坐标

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.2</version>
</dependency>

3.是否在Spring的配置文件中配置

<mvc:annotation-driven/>

4.版本冲突(尝试更换fackson等版本)

 

推荐阅读