title: JSON post to Spring Controller
body: <p>Hi I am starting with Web Services in Spring, so I am trying to develop small application in Spring + JSON + Hibernate. I have some problem with HTTP-POST. I created a method:</p>
  
  <pre><code>@RequestMapping(value="/workers/addNewWorker", method = RequestMethod.POST, produces = "application/json", consumes = "application/json")
  @ResponseBody
  public String addNewWorker(@RequestBody Test test) throws Exception {
      String name = test.name;
      return name;
  }
  </code></pre>
  
  <p>And my model Test looks like:</p>
  
  <pre><code>public class Test implements Serializable {
  
  private static final long serialVersionUID = -1764970284520387975L;
  public String name;
  
  public Test() {
  }
  }
  </code></pre>
  
  <p>By POSTMAN I am sending simply JSON {"name":"testName"} and I always get error;</p>
  
  <pre><code>The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.
  </code></pre>
  
  <p>I imported Jackson library. My GET methods works fine. I don't know what I'm doing wrong. I am grateful for any suggestions.</p>