Let's say I have the following JAX-RS web service:
public class HelloService {
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_PLAIN)
public String getMessage(@FormParam("name") String name) {
return "Hello, " + name + "!";
}
}
This web service will accept form parameters whether they're sent in the request body or sent in the URL (e.g. http://foo.bar/baz?name=qux
).
Is there a way that I can configure the web service to only accept form parameters that are sent in the request body?