1

I am using the following piece of code to perform an HTTP Request in Android. Everything seems fine, but it appears that the response gets clipped at some point and I can't read the full content of the requested url.

Is there any size limit on the response?

HttpClient httpclient = new DefaultHttpClient();
HttpGet request = new HttpGet(someUrl);
HttpResponse response = httpclient.execute(request);
StatusLine statusLine = response.getStatusLine();
if(statusLine.getStatusCode() == HttpStatus.SC_OK){
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    response.getEntity().writeTo(out);
    out.close();
    String responseString = out.toString();
    Log.w("Response", responseString);  // The response is clipped at some point
}

Thank you.

MobileCushion
  • 7,065
  • 7
  • 42
  • 62

1 Answers1

0

Ok, silly me. Turns out this is a log problem. I checked out for size and the full content is there. The problem lies with the size limitation for LogCat, as explained in the following answer.

What is the size limit for Logcat and how to change its capacity?

Cheers

Community
  • 1
  • 1
MobileCushion
  • 7,065
  • 7
  • 42
  • 62