How to retrieve the JSON message body in JAX-RS REST method?
<p>I have the following <code>JSON</code> that will be passed as part of a HTTP request, in the message body.</p>

<pre><code>{
    "names": [
        {
            "id":"&lt;number&gt;",
            "name":"&lt;string&gt;",
            "type":"&lt;string&gt;",
        }
    ]
}
</code></pre>

<p>My current <code>REST</code> handler is below. I am able to get the Id and `Version that is passed in as path params, but I am not sure how to retrieve the <strong>contents on the message body</strong>?</p>

<pre><code>        @PUT
        @Path("/Id/{Id}/version/{version}/addPerson")
        public Response addPerson(@PathParam("Id") String Id,
                                                @PathParam("version") String version) {

            if (isNull(Id) || isEmpty(version)) {
                return ResponseBuilder.badRequest().build();
            }

            //HOW TO RECIEVE MESSAGE BODY?

            //carry out PUT request and return DTO: code not shown to keep example simple


            if (dto.isSuccess()) {
                return Response.ok().build();
            } else {
                return Response.serverError().build();
            }

}
</code></pre>

<p>Note: I am using the <code>JAX-RS</code> framework.</p>