When the content type is application/json,@RequestBody can read the request body and deserialized into an Object, but the content type is application/x-www-form-urlencoded, spring-mvc can not support this content type with @RequestBody annotation.
In my project, I encountered this problem, I want to support both of them at the same time, but I don't want to lose the convenience of @RequestBody.
Is there another way to support these two content type and like @RequestBody can auto deserialized request body into an Object?
@RequestMapping(value = "/test")
public String test(@RequestBody User user) {
return user.toString();
}