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();
}
通过字符串接收,自己再解析一次.