I am making a request to an API and getting a response status code of 200
.
Response of the api includes a json
response.
i
You can use following code
String responseAsString = response.readEntity(String.class);
Try using the Response.getEntity() method, which returns an InputStream. Then, to convert your InputStream to a String, check this question. If you really need to map the JSON String to a Java entity, that consider calling directly the Response.readEntity(). Note that, if you consume the InputStream, you will probably have to process the input stream on your own.