hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: JDK vs HttpClient
Date Thu, 14 Aug 2008 20:09:08 GMT
On 14/08/2008, Jignesh Malkan <JMalkan@axeda.com> wrote:
> Hi,
>
>
>
>  I am trying to find the reasons to use HttpClient over JDK if app is
>  running in JDK 1.5 or higher.
>
>  Keep in mind most production environments allow users to access URL only
>  on port 80/443. Most proxies will not allow going through any other
>  ports.
>
>
>
>  Following line of code using JDK does all the magic including proxy
>  detection, authentication if required. It even does NTLM Authenticate
>  without prompting.
>

AFAIK, proxy detection requires system properties to be set.

AFAIK, NTLM is supported on Windows only due to MS licensing restrictions.

>
>  URL url = new URL( myUrl );
>
>  //  Try to set header values to improve PROXY performance
>
>  //  These are unnecessary for direct access, but don't hurt
>
>  URLConnection con = url.openConnection();
>
>  con.setRequestProperty("Connection","keep-alive");
>

It's simple - too simple.

There's no control over connection reuse.

You can't plug in your own socket factory, so it's impossible to do
things such as simulating slow connections.

>
>
>
>  Can anyone tell me why should I go through so much extra lines of code
>  and adding new third party JARs like HttpClient when this functionality
>  is available in JDK since version 1.4.2?
>
>
>
>
>
>  Jiggy.
>
>

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