断开HttpClient

时间:2012-01-29 21:01:20

标签: java httpclient disconnect

如何断开org.​apache.​http.​client.HttpClient对象的连接?
我正在创建它,但它没有任何disconnect()getHttpConnectionManager

HttpClient httpclient = new DefaultHttpClient();

由于

1 个答案:

答案 0 :(得分:4)

使用

httpClient.getConnectionManager().shutdown();

See examples

注意:getHttpConnectionManager来自HttpClient 3.1。