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: How replace the default HTTP URL handler in Java with one that uses the Apache HTTPClient?
Date Fri, 19 May 2017 07:33:21 GMT
On Thu, 2017-05-18 at 09:49 +0000, Mats Eklund wrote:
> Hi,
> I am thinking of replacing the default HTTP connection handler in my
> Java web applications with one that uses Apache HTTPClient. The
> reason is that I want to leverage response caching of outbound HTTP
> requests made from my web application. The requests are made via
> various libraries, all using the standard java.net.URL class to
> access resources on the web.
> Does the HTTP Components framework contain a ready to use solution
> for this, or are there some guidelines available for how to best go
> about it. I guess what I am looking for could be a common scenario! I
> found some possible directions here:
> http://mjremijan.blogspot.co.at/2012/02/create-your-own-java-url-hand
> lers.html
> http://stackoverflow.com/questions/27993995/creating-httpurlconnectio
> n-for-urlstreamhandlerfactory-getting-error-
> protocol/28101085#28101085
> But maybe there is already a ready to use component available, that
> could be simply dropped along with a configuration file for the
> caching behavior into the application's libraries folder?
> Thanks so much in advance for any advice!
> Mats

A long time ago (more than 10 years back) there was an effort to
provide a HttpUrlConnection compatibility facade but it was eventually
abandoned as pointless. HttpUrlConnection APIs are so bad that is no
point supporting them. We might at some point look at providing a
compatibility layer for the coming HTTP client APIs in Java 1.9.


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

View raw message