Java Tech

如无必要,勿增实体

标签 "not acceptable" 下的文章

Spring MVC + JSON = 406 Not Acceptable

  在开发接口时发现了一个很好玩的问题,两个接口均是restful形式,参数在URL路径中传递,返回结果形式均为json,但是在接口测试时,一个接口正常,另一个接口报错:The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.本文来分析一下其中的原因。