hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Any up-to-date comparison of HttpClient vs. HttpUrlConnection?
Date Thu, 28 Jan 2010 11:49:31 GMT
On 28/01/2010, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Wed, 2010-01-27 at 15:08 -0800, KARR, DAVID (ATTCINW) wrote:
>  > Every once in a while, informal discussions come up about the advantages
>  > of HttpClient vs. HttpUrlConnection.  Is there an up to date version of
>  > that comparison, so someone could review it point by point?  There are
>  > old versions of this, like at
>  > <http://www.innovation.ch/java/HTTPClient/urlcon_vs_httpclient.html>,
>  > but that's so old, it's not even fair. :)
>  >
>
>
> None I am aware of.
>
>  In the early days of Java (around releases 1.1.8 and 1.2.0)
>  HttpUrlConnection used to be completely and helplessly broken. These
>  days if HttpUrlConnection covers all your needs, there is no reason to
>  use HttpClient.

We started using HttpClient 3.x in JMeter because of the following
restrictions in HttpUrlConnection:

* it gave no control over connection re-use. An active connection may
be returned to a different thread next time
* it used system properties to control some aspects of its behaviour;
this is hopeless for multi-threaded applications that may want
different behaviour in different threads.
* it did not give access to the SocketFactory for non-SSL requests, so
one cannot implement a slow socket

There might have been another reason; I forget now.

Some or all of these issues may have been addressed in recent versions
of HttpUrlConnection.

HTH

>
>  Oleg
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message