I am converting one of my existing services to become RESTful, and I have the basic things that work with RestEasy. Some of my client applications should be able to execute both GET and POST requests to multiple services. I'm just looking if there is any easy way for jax-rs to indicate that the API should accept both GET and POST. After you can find the testing method, let me know if you see any way without duplicating it in another class using @GET and @QueryParam.
@POST @Path("/add") public Response testREST(@FormParam("paraA") String paraA, @FormParam("paraB") int paraB) { return Response.status(200) .entity("Test my input : " + paraA + ", age : " + paraB) .build(); }
source share