0
我试图从我的办公室服务器获得响应。响应至少有50,000行。但我没有得到完整的回应。我不知道哪里出了问题。是否完整的数据没有得到下载或任何其他问题与我的InputStream?在Android中不完整的http响应
HttpClient httpClient = new DefaultHttpClient();
HttpContext httpcontext = new BasicHttpContext();
HttpPost httpPost = new HttpPost(mUrl);
HttpResponse mResponse = httpClient.execute(httpPost, httpcontext);
InputStream mResponseStream = mResponse.getEntity().getContent();
BufferedReader br = new BufferedReader(new InputStreamReader(mResponseStream));
String line = "";
while ((line = br.readLine()) != null) {
line = line.replaceAll("[\r\n]", "");
Log.v("Response", line);
}
所需的响应:
02-17 18:32:14.000: D/Lib(4121): Starts
02-17 18:32:14.010: D/Lib(4121): 12080964|~|1370.00
02-17 18:32:14.010: D/Lib(4121): 12083142|~|500.00
02-17 18:32:14.020: D/Lib(4121): 13051372|~|100.00
02-17 18:32:14.020: D/Lib(4121): 13040457|~|12.00
02-17 18:32:14.060: D/Lib(4121): 12010037|~|170.00
02-17 18:32:14.060: D/Lib(4121): .........
02-17 18:32:14.060: D/Lib(4121): Ends
获得响应:
02-17 18:32:14.000: D/Lib(4121): Starts
02-17 18:32:14.010: D/Lib(4121): 12080964|~|1370.00
02-17 18:32:14.010: D/Lib(4121): 12083142|~|500.00
02-17 18:32:14.020: D/Lib(4121): 13051372|~|100.00
02-17 18:32:14.020: D/Lib(4121): 13040457|~|12.00
02-17 18:32:14.060: D/Lib(4121): 12010037|~|170.00
02-17 18:32:14.060: D/Lib(4121): .........
我的回答总是Starts
关键字开始,以Ends
关键字结束。总是我没有得到Ends
关键字。行号在25,000到33,000行之间停止响应。谢谢。
,你会得到什么,当你用手或通过像卷曲的工具要求呢? (顺便说一句:你应该做GET请求,而不是POST - 你发送任何东西都不需要POST) –
试图给大小BufferedReader – Sonali8890
@MarcinOrlowski我发送数据进行身份验证,我没有使用卷曲。 – SathishKumar