Reputation: 876
Read tutorials on using httpClient(HttpClient API by Apache), it said that we should have only one instance of HttpClient. So Below are my doubts..
Upvotes: 2
Views: 2084
Reputation: 24454
Because your HttpClient instance holds session data like cookies, credentials and so on. Even if you only use one single HttpClient instance, you're able to use multiple connections if you use a thread safe connection manager:
http://hc.apache.org/httpclient-legacy/threading.html
Technically, it is possible to use multiple instances in parallel, but then don't mix them up and use them independently!
Upvotes: 5