MIME types and marshalling
44.1.4. MIME types and marshalling. The Content-Type header sent in the request is controlled by the $contentType parameter which overrides the @Consumes annotation on the JAX-RS endpoint. The value passed as entity body using the $entity parameter is marshalled according to both its type and content type: Table 44.3. Controlling sent entities Type MIME Description DOM Element Empty or text/xml,application/xml,application/*+xml The DOM Element is marshalled to XML before being sent. JavaScript Object (JSON) Empty or application/json The JSON object is marshalled to a JSON string before being sent. Anything else Anything else The entity is sent as is.