获取状态代码为406 "The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers."
将spring版本(3.1.2
升级到3.2.13
)时,我从服务器收到406错误。
Content-Type of Response headers:"Content-Type:text/html;charset=utf-8".
Request Header is Accept: application/json, text/javascript, */*; q=0.01.
JavaCode:"@RequestMapping(value = "/search",method = RequestMethod.POST,consumes = "application/json", produces = "application/json")".
Ajax电话:
$.ajax({
url : /search.htm,
dataType : json,
data : postData,
contentType: application/json,
.
.
.});
但在使用以下配置时,它的工作效果非常好。(此处为Content-Type
的响应标头:application/json
)
请帮我解决此问题。