Java Content type ‘text/plain;charset=UTF-8‘ not supported问题解决

问题描述:

org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/plain;charset=UTF-8' not supported

问题分析:

1、使用PostMan调试后端接口时,请求体里面的content type为text/plain,但是后端接口不支持text/plain,只支持application/json。

解决办法:

swagger-ui.html页面支持application/json,使用swagger-ui.html页面进行传参即可。

Java Content type ‘text/plain;charset=UTF-8‘ not supported问题解决

上一篇:2021-03-09


下一篇:MSSQL项目导入数据库:The server version or database compatibility level is not supported