如何获取 HTTP 请求的进程百分比?我有这个请求的代码:
HttpClient requestclient = new DefaultHttpClient();
HttpResponse requestresponse = requestclient.execute(new HttpGet("example.com"));
StatusLine requeststatus = requestresponse.getStatusLine();
if(requeststatus.getStatusCode() == HttpStatus.SC_OK){
ByteArrayOutputStream requestoutput = new ByteArrayOutputStream();
requestresponse.getEntity().writeTo(requestoutput);
requestoutput.close();
String requestresult = requestoutput.toString();
return requestresult;
} else{.
requestresponse.getEntity().getContent().close();
throw new IOException(requeststatus.getReasonPhrase());
}
谢谢!