Hi,
Generally it is better to have only 1 HttpClient instance and to reuse it.
http://hc.apache.org/httpclient-legacy/performance.html#Reuse_of_HttpClient_instance
Regards,
Francois-Xavier
On 13/02/2013 12:39, Ravi Joshi wrote:
Hi,
Just now I started using apache httpcomponents-client.
My purpose is to send some POST and GET HTTP request one at a time. For this I
am
following the resources provided in the Apache Httpcomponents Web.
All the time before sending any request
I need to create a new instance of org.apache.http.impl.client.DefaultHttpClient
. Am I going right way? In my opinion DefaultHttpClient should be instantiated
only once then POST, GET request can be sent using
org.apache.http.client.methods.HttpPost
and org.apache.http.client.methods.HttpGet
respectively.
Correct?
Any helpful web resources always be appreciated.
-
Thanks
Ravi Joshi