您的位置:首页 > 理论基础 > 计算机网络

HttpMediaTypeNotAcceptableException: Could not find acceptable representation原因及解决方法

2017-11-28 16:15 1216 查看


HttpMediaTypeNotAcceptableException: Could not find acceptable representation


错误原因:请求contenttype=application/json;charset=UTF-8,而这里的produces=text/html

原来代码:
@RequestMapping(value = "/upload", method = RequestMethod.POST, produces = "text/html; charset=UTF-8")

解决方法:去掉 produces = "text/html; charset=UTF-8"这段代码或者设置produces=application/json;charset=UTF-8
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  springboot springmvc
相关文章推荐