您的位置:首页 > 理论基础 > 计算机网络

org.apache.commons.httpclient.HttpClient 与 org.apache.http.client.HttpClient 区别

2016-01-06 13:25 579 查看
因为工作需要,要使用Java代码模拟登录过程,抓取某系统的订单数据;

上网查询资料,发现使用HttpClient可以模拟登录过程;

本着取各家之长的态度,发现有些博文使用了 org.apache.commons.httpclient.HttpClient 类,

另外有些博文则使用了 org.apache.http.client.HttpClient 类;

为了搞清楚其中的关系,找度娘,却不甩我;

无意中,从官网看到一段话,



原来,commons-httpclient 是 apache-commons 项目下的一个子项目,后来被 HttpComponents 取代,

后者提供了更好的性能和更大的灵活性。
原文地址如下:http://hc.apache.org/httpclient-3.x/

PS:
commons-httpclient的GAV地址为

<dependency>
  <groupId>commons-httpclient</groupId>
  <artifactId>commons-httpclient</artifactId>
  <version>3.1</version>
</dependency>

其最新版本为3.1,且已经不再更新;

HttpComponents的GAV地址为
<dependency>

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

截止目前(2016-01-05),最新版本为4.5.1;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息