【Problems】:JSON parse error: Invalid UTF-8 start byte 0xbd;

简单记录一下 ,我本地开发环境这样写测试时没有问题,

@ApiOperation(value="取消关注")
@PostMapping("cancelFollow")
public R cancelFollow(@RequestBody CancelFollowVo cancelFollowVo) {
}

当我部署到服务器上时测试出现了这个问题

Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@e5457c0]
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Invalid UTF-8 start byte 0xbd; nested exception is com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0xbd
 at [Source: (PushbackInputStream); line: 1, column: 3]

JSON parse error: Invalid UTF-8 start byte 0xbd;

我加上这个application/json;charset=UTF-8就好了。。。

@ApiOperation(value="取消关注")
@PostMapping(value = "cancelFollow",produces = "application/json;charset=UTF-8")
public R cancelFollow(@RequestBody CancelFollowVo cancelFollowVo) {
}
posted @ 2020-04-05 01:23  渐若窥宏大  阅读(12430)  评论(0编辑  收藏  举报