commons-httpclient 和 httpclient 区别

今天在看项目的pom的时候,发现里面有这么两个包依赖。
<dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency>

<dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.2</version> </dependency>

发现项目里面用到它们的地方也差不多,都是用来处理http请求。去查阅发现,这两个包在同一个官网上面都可以找到。

点击commons-httpclient的链接,在页首写着这么一句话。

The Commons HttpClient project is now end of life, and is no longer being developed. It has been replaced by the Apache HttpComponents project in its HttpClient and HttpCore modules, which offer better performance and more flexibility.

上面的意思是:Commons Httpclient这个项目不再进一步完善了,它已经被Httpclient项目的两个子模块HttpClient和HttpCore所取代了,后者在持续更新和完善中。

关于这个问题,在stackoverflow上面找到有详细讨论

最后,对于新开的项目,还是使用httpclient吧。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容