springmvc报错如下:
The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.
使用场景:
在后台方法参数上添加@RequestBody时,将请求参数封装成User对象时,需要JSON(application/json)格式解决:在Postman中如下设置即可正常访问,便于调试。
不能使用表单。要使用需要结合ajax设置content-type:json
改为使用postman进行测试,就可以正常访问了
然后使用json进行传递参数