post 请求传对象及解决406问题

一、post请求传对象:

(1)传参注解:

public Object getName(@RequestBody Student student){

return  "";

}

注:传参用@RequestBody,而非@RequestParam;

(2)用postman发送请求

二、解决406问题

HTTP Status 406 -

@RequestMapping(value = "/v2/expresscallback/kuaidi100/expressNotify", method = RequestMethod.POST,produces = "text/html;charset=UTF-8")

去掉  ,produces = "text/html;charset=UTF-8" 即可

扫描二维码关注公众号,回复: 5135007 查看本文章

猜你喜欢

转载自www.cnblogs.com/qqzhulu/p/10342886.html