首页 > 其他 > 详细

Could not find acceptable representation错误

时间:2019-03-11 19:10:02      阅读:949      评论:0      收藏:0      [点我收藏+]

Could not find acceptable representation:“找不到可接受的形式”

发现可能出发这种异常情况的原因:

请求contenttype=application/json;charset=UTF-8,而这里是produces=text/html

原来代码:

@RequestMapping(value = "/getPage.action", method = RequestMethod.POST, produces = "text/html; charset=UTF-8")

解决方法:去掉produces = "text/html; charset=UTF-8"这段代码或者设置produces=application/json;charset=UTF-8

如果返回的信息是提示信息如“修改成功”等,则produces="text/html;charset=UTF-8",但如果返回的信息是json数据,则produces="application/json;charset=UTF-8"




Could not find acceptable representation错误

原文:https://www.cnblogs.com/h-wt/p/10512454.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!