使用HttpClient要注意的问题

1.每次执行一个Method都要release connection,而且要放到finally块里release

2. ONE multi-trhread httpclient = n httpconnections。对同一个Host的默认连接数只有2

3.执行method.getResponseBodyXXX()方法时,responseBody已经下载到本地。所以,执行这种方法时,程序不会访问网络。

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.