title: URL parameters are not being passed by curl POST
body: <p>This is my java code:</p>
  
  <pre><code>@POST
  @Path("/sumPost")
  @Produces(MediaType.TEXT_PLAIN)
  public String sumPost(@QueryParam(value = "x") int x,
          @QueryParam(value = "y") int y) {
      System.out.println("x = " + x);
      System.out.println("y = " + y);
      return (x + y) + "\n";
  }
  </code></pre>
  
  <p>I call it like this:</p>
  
  <pre><code>curl -XPOST "http://localhost:8080/CurlServer/curl/curltutorial/sumPost" -d 'x:5&amp;y:3'
  </code></pre>
  
  <p>The problem is the <code>System.out.println</code> call keeps posting zero zero, it seems I am not passing x and y correctly.</p>
  
  <h3>Update</h3>
  
  <p>After the answer, I changed my request to:</p>
  
  <pre><code>curl   -d '{"x" : 4, "y":3}'  "http://localhost:8080/CurlServer/curl/curltutorial/sumPost" -H "Content-Type:application/json" -H "Accept:text/plain"  --include
  </code></pre>
  
  <p>and the service is:</p>
  
  <pre><code>@POST
  @Path("/sumPost")
  @Produces(MediaType.TEXT_PLAIN)
  @Consumes(MediaType.APPLICATION_JSON)
  public String sumPost(@QueryParam(value = "x") int x,
          @QueryParam(value = "y") int y) {
      System.out.println("sumPost");
      System.out.println("x = " + x);
      System.out.println("y = " + y);
      return (x + y) + "\n";
  }
  </code></pre>
  
  <p>but I still have the same problem. Here is the response from the server:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Server: Apache-Coyote/1.1
  Content-Type: text/plain
  Transfer-Encoding: chunked
  Date: Wed, 23 Sep 2015 11:12:38 GMT
  
  0
  </code></pre>
  
  <p>You can see the zero at the end :(</p>