hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject RE: Any up-to-date comparison of HttpClient vs. HttpUrlConnection?
Date Wed, 03 Feb 2010 10:30:05 GMT
On Sat, 2010-01-30 at 16:13 -0800, KARR, DAVID (ATTCINW) wrote:
> > -----Original Message-----
> > From: Oleg Kalnichevski [mailto:olegk@apache.org]
> > Sent: Saturday, January 30, 2010 2:40 PM
> > To: HttpClient User Discussion
> > Subject: RE: Any up-to-date comparison of HttpClient vs.
> > HttpUrlConnection?
> > 
> > On Fri, 2010-01-29 at 11:29 -0800, KARR, DAVID (ATTCINW) wrote:
> > 
> > ...
> > 
> > > >
> > > > http://java.sun.com/javase/7/docs/api/java/net/doc-files/net-
> > > > properties.html
> > > >
> > > > has a long list of properties.
> > >
> > > Can someone pick out features supported by those properties that are
> > > supported on a client basis with HttpClient (as opposed to setting
> > > system properties)?  For instance, if I needed one connection to use
> > > NTLM auth, but only that connection, would this mean that all
> > > connections using HttpUrlConnection would be forced to use NTLM auth?
> > > Would HttpClient allow doing that on a client basis instead?
> > >
> > 
> > HttpClient does not make use of system properties at all. Virtually
> > every aspect of the HTTP protocol can be overridden on a per request
> > basis (using HTTP parameters) or on a per client / thread basis (using
> > HTTP context).
> 
> I'm aware of that.  I'm just looking for specific examples of this, where HUC implements
it with a system property, and basically how HttpClient provides it on a request or client
basis.
> 

Timeouts for instance.

> Even more important, I'm trying to determine if there are features that HttpClient provides
which just aren't practical at all with HUC.  For instance, is it possible to get "preemptive
authentication" with HUC?  Is it possible to connect with SSL to a server using a self-signed
certificate with HUC?  I'm familiar with doing preemptive auth with HttpClient, but I only
briefly read about the self-signed cert issue a long time ago.

Both scenarios should be possible with HUC. The problem is that HUC API
is just plain ugly and cumbersome, and this can affect your application
code. For example, one can use protocol interceptors with HttpClient in
order to introduce a cross cutting aspect for all outgoing requests and
incoming responses, which is simply not possible with HUC. So, the
differentiating factor is the quality of API, not the feature list. Just
pick the one you like better.

Oleg


---------------------------------------------------------------------
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