我有一个要求,即使用url编码的数据和应用程序json的api在相同的端点上都以不同的方式运行
ljo96ir51#
不,它不会像这样工作,它将按照请求Map工作,如get post可选更新等但是你可以像这样调整和完成你的工作
//Post method #1 @RequestMapping(method=RequestMethod.POST, value="/foo", headers="returnType=withoutcertainformat") public @ResponseBody Foo updateFoo(@RequestBody Foo foo) { fooService.update(foo); } //Post method #2 @RequestMapping(method=RequestMethod.POST, value="/foo", headers="returnType=withcertainformat") public @ResponseBody FooExtra updateFoo(@RequestBody FooExtra fooExtra) { fooService.update(fooExtra); }
1条答案
按热度按时间ljo96ir51#
不,它不会像这样工作,它将按照请求Map工作,如get post可选更新等
但是你可以像这样调整和完成你的工作