I am developing RESTful services with Jersey and it works great with GET
methods. But I can only get null
parameters using the POST
method. Here is the sample code from my project.
HTML
<form action="rest/console/sendemail" method="post">
<input type="text" id="email" name="email">
<button type="submit">Send</button>
</form>
Java
@POST
@Path("/sendemail")
public Response sendEmail(@QueryParam("email") String email) {
System.out.println(email);
return new Response();
}
The email I get from the post is always null. Anyone has the idea?
I changed QueryParam to FormParam, the parameter I get is still null.