I\'m communicating with an API that I can not change that sends a 400 response when a request is not validated on the API side. It is a valid HTTP request, but the request data
Something like this, using org.apache.http.util.EntityUtils:
HttpRequestBase base = new HttpGet(url);
HttpResponse response = httpClient.execute(base);
String jsonString = EntityUtils.toString(response.getEntity());
PS: This is blind coding as I don't know what you tried yet.
To get status code:
int statusCode = response.getStatusLine().getStatusCode();
To get the entity body in byte array:
byte[] data = EntityUtils.toByteArray(response.getEntity());