I am using Jersey 1.8 in my application. I am trying to consume POST
data at the server. The data is of the type application/x-www-form-urlencoded
.
Got it. As per this document, I can use a MultivaluedMap
or Form to get all the POST data of the type application/x-www-form-urlencoded
in one object. A working exmple:
@POST
@Path("/urienodedeample")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON)
public Response uriEncodedExample(MultivaluedMap multivaluedMap) {
logger.info(multivaluedMap);
return Response.status(200).build();
}