Any relationship or difference between those two libraries.
Designed for extension while providing robust support for the base HTTP protocol, HttpClient may be of interest to anyone building HTTP-aware client applications such as web browsers, web service clients, or systems that leverage or extend the HTTP protocol for distributed communication.
The Jakarta Commons HttpClient component seeks to fill this void by providing an efficient, up-to-date, and feature-rich package implementing the client side of the most recent HTTP standards and recommendations. See the Features page for more details on standards compliance and capabilities.
HttpComponents Client HttpClient is a HTTP/1.1 compliant HTTP agent implementation based on HttpCore. It also provides reusable components for client-side authentication, HTTP state management, and HTTP connection management. HttpComponents Client is a successor of and replacement for Commons HttpClient 3. x.
Commons HttpClient is an old project that produced HttpClient 3.1. The project was subsumed by the larger Apache HttpComponents project, which produced HttpClient 4.x.
It's rather confusing and a bit political, but the old Commons HttpClient library is now deprecated.
Any ... difference between those two libraries.
Yes. They are very different. The package names are different for a start, and the 4.x
APIs are much richer than the 3.x
APIs.
For a start the 4.x
HttpClient APIs are based on core libraries that are designed to support both the client and server sides of HTTP. The core is designed to support both blocking I/O and event driven I/O, and there is an AsyncHttpClient API top support the latter. The framework also has a lot in the way of cookie management, connection management, client-side authentication, proxy routing, resource handling and streaming, etc.
Sadly, this all means that code that was built to use HttpClient 3.x would need a major rewrite to use HttpClient 4.x. I guess this is the source of the confusion and politics that @skaffman alludes to.
But for me, the bottom line is that if you are developing new project, you should be using HttpClient 4.x.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With