How to Parse javax.ws.rs.core.Response
For JAX-RS 2.x Client API, use Response.readEntity(InputStream.class)
. Alternatively, is you don't need any specific information from the Response
object, you can simple do
InputStream is = client.target(enpoint).request(
MediaType.APPLICATION_XML).get(InputStream.class);
Also works:
MyResponse myResponse = response.readEntity(MyResponse.class);