Content type 'text/plain;charset=UTF-8' not supported


报错: Content type 'text/plain;charset=UTF-8' not supported

@RequestMapping("test")
public Result test(@RequestBody ProtalQuery query) {
     ...
    return Result.success();
}

一开始使用对象方式接受数据,一直报错. 改成下面形式就好了!

@RequestMapping("test")
public Result test(@RequestBody String json) {
    ProtalQuery query = JSON.parseObject(json, ProtalQuery.class);
     ...
    return Result.success();
}

通过字符串接收,自己再解析一次.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM