我正在使用以下代码在 Android 中执行 HTTP 请求。一切似乎都很好,但似乎响应在某个时候被截断,我无法阅读请求的 url 的全部内容。
响应有大小限制吗?
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
}
谢谢你。