title: JAX-RS get body parameters
body: <p>In javascript I am making an ajax post request to one of my JAX-RS functions like this</p>
  
  <pre><code> var postPackingListRequest = $http({
                method: "post",
                url: "/rest/v1/submit",
                data: $scope.items
            });
  </code></pre>
  
  <p>And now in my JAX-RS method I am trying to get the varibale <code>$scope.items</code> that was passed. I know I can get path params in the path like this</p>
  
  <pre><code>public Response getPathParams(@QueryParam("id") int id) {
  </code></pre>
  
  <p>But how can I get the data, which is passed in the body?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>@POST
  @Path("submit")
  @Consumes(MediaType.APPLICATION_JSON)
  @ApiResponses({ @ApiResponse(code = 201, response = Response.class) })
  @Produces("application/json")
  public Response submitPackingList(TestUser testUser) {
  
  }
  
  public class TestUser {
      public String id;
      public String name;
      public String getId() {
          return id;
      }
      public void setId(String id) {
          this.id = id;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>When I send a request to this with the TestUser there I am getting a HTTP 400 error. Here is how I am sending it</p>
  
  <pre><code>var postPackingListRequest = $http({
                method: "post",
                url: "/rest/v1/submit",
                data: "{'user':'1', 'name':james}"
            });
  </code></pre>