URL parameters are not being passed by curl POST
This is my java 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"; } I call it like this: curl -XPOST "http://localhost:8080/CurlServer/curl/curltutorial/sumPost" -d 'x:5&y:3' The problem is the System.out.println call keeps posting zero zero, it seems I am not passing x and y correctly. Update After the answer, I changed my request to: curl -d '{"x" : 4, "y":3}' "http://localhost:8080/CurlServer/curl