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