我将如何获取 org.apache.commons.httpclient.methods.PostMethod 或 org.apache.commons.httpclient.HttpClient 对象的底层 HttpConnection?
user1732480
问问题
156 次
1 回答
0
如果您有一个实例,HttpClient
则可以使用它来获取HttpConnection
参考:
PostMethod post = new PostMethod(url);
// ...
HttpClient httpclient = new HttpClient();
httpclient.getHttpConnectionManager().getConnection(HostConfiguration.ANY_HOST_CONFIGURATION);
// ...
httpclient.executeMethod(post);
于 2013-07-17T08:32:50.290 回答