Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what the relationship between commons-httpclient and httpclient, both from apache

Any relationship or difference between those two libraries.

like image 968
user496949 Avatar asked Mar 01 '11 10:03

user496949


People also ask

What is Apache HttpClient used for?

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.

What is Jakarta Commons HttpClient?

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.

What is org Apache HttpComponents HttpClient?

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.


2 Answers

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.

like image 111
skaffman Avatar answered Oct 12 '22 11:10

skaffman


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.

like image 33
Stephen C Avatar answered Oct 12 '22 11:10

Stephen C