刚接手了一个快收尾的项目,前期一直用的postMan,记录一个坑。
接口写完后测试,
POSTMAN报错信息:
{
"msg": "Content type 'text/plain;charset=UTF-8' not supported",
"code": 500
}
后台报错信息:
15:05:16.202 [http-nio-8880-exec-6] ERROR c.t.f.w.e.GlobalExceptionHandler - [handleException,74] - Content type 'text/plain;charset=UTF-8' not supported
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/plain;charset=UTF-8' not supported
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:224)
解决办法:
疏忽大意了,需要在postman中切换下数据类型。