Spring MVC send object as @RequestBody
<p>I am following <a href="http://websystique.com/springmvc/spring-mvc-4-restful-web-services-crud-example-resttemplate/" rel="nofollow">websystique Spring 4 MVC tutorial</a> and I am trying to figure out how to send <code>http</code> request to match the create user <code>method</code>:</p>

<pre><code> //-------------------Create a User--------------------------------------------------------

    @RequestMapping(value = "/user/", method = RequestMethod.POST)
    public ResponseEntity&lt;Void&gt; createUser(@RequestBody User user,    UriComponentsBuilder ucBuilder) {
        System.out.println("Creating User " + user.getName());

        if (userService.isUserExist(user)) {
            System.out.println("A User with name " + user.getName() + " already exist");
            return new ResponseEntity&lt;Void&gt;(HttpStatus.CONFLICT);
        }

        userService.saveUser(user);

        HttpHeaders headers = new HttpHeaders();
        headers.setLocation(ucBuilder.path("/user/{id}").buildAndExpand(user.getId()).toUri());
        return new ResponseEntity&lt;Void&gt;(headers, HttpStatus.CREATED);
    }
</code></pre>

<p>Or in general how to send a object via <code>@RequestBody</code> that match my user object(<code>POJO</code>):</p>

<pre><code>public class User {

    private String m_name;
    private long m_id;
    private int m_age;
    private int m_salary;

    public User(String name, long id, int age, int salary){
        this.m_name = name;
        this.m_id = id;
        this.m_age = age;
        this.m_salary = salary;
    }
    //getters, setters...
}
</code></pre>