Jen*_*nny 10 java apache-commons-httpclient
我设法对以下所有内容进行了更改:
HttpClient client;
HttpPost method;
client = new DefaultHttpClient();
method = new HttpPost(url);
InputStream rstream;
try {
rstream = method.getResponseBodyAsStream();
} catch (IOException e) {
return BadSpot(e.getMessage());
}
Run Code Online (Sandbox Code Playgroud)
我不确定的是我应该替换getResponseBodyAsStream().
InputStream rstream;
try {
HttpResponse response = client.execute(HttpHost, method);
rstream = response.getEntity().getContent();
} catch (IOException e) {
return BadSpot(e.getMessage());
}
Run Code Online (Sandbox Code Playgroud)
以上应该做你所要求的。