I am using apache HttpClient (via Fluent API). When I return the response object, I first do:
response.returnResponse().getStatusLine().getStatusCode()
If the status code is 4xx or 5xx, I throw an exception or return the contents:
response.returnContent().asBytes();
response Here is an object of type response . But when I run this, I get:
java.lang.IllegalStateException: Response content has been already consumed.
How can I get around this?
Sayak banerjee
source share