org.apache.httpcomponents » httpclient
原来,commons-httpclient 是 apache-commons 项目下的一个子项目,后来被 HttpComponents 取代,
后者提供了更好的性能和更大的灵活性。
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;
The type DefaultHttpClient is deprecated
HttpClient client = new DefaultHttpClient();
改为:
HttpClient client = HttpClientBuilder.create().build();