Jersey has a provider for mapping JSON objects to Java. To map the request body to an object, simply specify the object as an argument to the resource method. If you need raw JSON, specify an object of type java.lang.String .
@Path("/mypath") public class MyResource { @POST @Path("/aspojo") @Consumes(MediaType.APPLICATION_JSON) public Response myResourceMethod(MyPojo pojo) {
source share