As requested on the Spring Boot issue tracker:

https://github.com/spring-projects/spring-boot/issues/3890

—

When processing an HttpRequest with x-www-form-urlencoded content, we can use a controller with POJO matching the payload structure.

Example payload: value_first=value1&value_second=value2

@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) public String handlePost(@ModelAttribute Body body) { }

POJO:

public class Body { private String value_first; private String value_second; }

The problem is that the variable names must match the field names in the HttpRequest payload in order to be processed by the controller. There is not way of naming them differently, for example, if I do not want to use underscores in Java variable and method names.

What I would appreciate would be using something like this: