我正在发送一个 HttpPost 请求并以 JSON 格式获取响应。但是,由于响应如此巨大,与我在浏览器中看到的相比,我只收到一小部分响应。我的代码如下:
StringBuilder builder = new StringBuilder();
HttpPost httpPost = new HttpPost(uri);
HttpResponse response = client.execute(httpPost);
HttpEntity entity = response.getEntity();
InputStream content = entity.getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(content));
String line;
while ((line = reader.readLine()) != null) {
builder.append(line);
}
由于默认缓冲区大小为 8192 个字符。我只是尝试提供更多价值,但这没关系。所以,关于这个的任何建议......