Updated web site for HttpClient 4.3-alpha1 release

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1434034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2013-01-16 16:52:42 +00:00
parent 2ea3298894
commit 7ff88c8faa
3 changed files with 28 additions and 21 deletions

View File

@ -42,46 +42,46 @@ HttpClient Downloads
in your {{{http://maven.apache.org/guides/introduction/introduction-to-the-pom.html}pom.xml}} in your {{{http://maven.apache.org/guides/introduction/introduction-to-the-pom.html}pom.xml}}
by adding the following block to the dependency descriptor: by adding the following block to the dependency descriptor:
* {HttpComponents Client 4.2.1} * {HttpComponents Client 4.3 Alpha 1}
------------------------- -------------------------
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.2.1</version> <version>4.3-alpha1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
------------------------- -------------------------
* {HttpComponents HttpMime 4.2.1} * {HttpComponents HttpMime 4.3 Alpha 1}
------------------------- -------------------------
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId> <artifactId>httpmime</artifactId>
<version>4.2.1</version> <version>4.3-alpha1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
------------------------- -------------------------
* {HttpComponents HttpClient Cache 4.2.1} * {HttpComponents HttpClient Cache 4.3 Alpha 1}
------------------------- -------------------------
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-cache</artifactId> <artifactId>httpclient-cache</artifactId>
<version>4.2.1</version> <version>4.3-alpha1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
------------------------- -------------------------
* {HttpComponents HttpClient Fluent 4.2.1} * {HttpComponents HttpClient Fluent 4.3 Alpha 1}
------------------------- -------------------------
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId> <artifactId>fluent-hc</artifactId>
<version>4.2.1</version> <version>4.3-alpha1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
------------------------- -------------------------

View File

@ -44,6 +44,11 @@ HttpClient Examples
This example demonstrates how to ensure the release of the underlying HTTP connection back to This example demonstrates how to ensure the release of the underlying HTTP connection back to
the connection manager in case of a manual processing of HTTP responses. the connection manager in case of a manual processing of HTTP responses.
* {{{./httpclient/examples/org/apache/http/examples/client/ClientConfiguration.java}HttpClient configuration}}
This example demonstrates how to customize and configure the most common aspects of HTTP request execution
and connection management.
* {{{./httpclient/examples/org/apache/http/examples/client/ClientAbortMethod.java}Abort method}} * {{{./httpclient/examples/org/apache/http/examples/client/ClientAbortMethod.java}Abort method}}
This example demonstrates how to abort an HTTP request before its normal completion. This example demonstrates how to abort an HTTP request before its normal completion.
@ -106,6 +111,11 @@ HttpClient Examples
scheme. Generally, preemptive authentication can be considered less secure than a response to scheme. Generally, preemptive authentication can be considered less secure than a response to
an authentication challenge and therefore discouraged. an authentication challenge and therefore discouraged.
* {{{./httpclient/examples/org/apache/http/examples/client/ProxyTunnelDemo.java}Proxy tunnel}}
This example shows how to use ProxyClient in order to establish a tunnel through an HTTP proxy
for an arbitrary protocol.
* {{{./httpmime/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java}Multipart encoded request entity}} * {{{./httpmime/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java}Multipart encoded request entity}}
This example shows how to execute requests enclosing a multipart encoded entity. This example shows how to execute requests enclosing a multipart encoded entity.

View File

@ -56,16 +56,14 @@ HttpClient Quick Start
------------- -------------
DefaultHttpClient httpclient = new DefaultHttpClient(); CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet("http://targethost/homepage"); HttpGet httpGet = new HttpGet("http://targethost/homepage");
CloseableHttpResponse response1 = httpclient.execute(httpGet);
HttpResponse response1 = httpclient.execute(httpGet);
// The underlying HTTP connection is still held by the response object // The underlying HTTP connection is still held by the response object
// to allow the response content to be streamed directly from the network socket. // to allow the response content to be streamed directly from the network socket.
// In order to ensure correct deallocation of system resources // In order to ensure correct deallocation of system resources
// the user MUST either fully consume the response content or abort request // the user MUST either fully consume the response content or abort request
// execution by calling HttpGet#releaseConnection(). // execution by calling CloseableHttpResponse#close().
try { try {
System.out.println(response1.getStatusLine()); System.out.println(response1.getStatusLine());
@ -74,7 +72,7 @@ try {
// and ensure it is fully consumed // and ensure it is fully consumed
EntityUtils.consume(entity1); EntityUtils.consume(entity1);
} finally { } finally {
httpGet.releaseConnection(); response1.close();
} }
HttpPost httpPost = new HttpPost("http://targethost/login"); HttpPost httpPost = new HttpPost("http://targethost/login");
@ -82,7 +80,7 @@ List <NameValuePair> nvps = new ArrayList <NameValuePair>();
nvps.add(new BasicNameValuePair("username", "vip")); nvps.add(new BasicNameValuePair("username", "vip"));
nvps.add(new BasicNameValuePair("password", "secret")); nvps.add(new BasicNameValuePair("password", "secret"));
httpPost.setEntity(new UrlEncodedFormEntity(nvps)); httpPost.setEntity(new UrlEncodedFormEntity(nvps));
HttpResponse response2 = httpclient.execute(httpPost); CloseableHttpResponse response2 = httpclient.execute(httpPost);
try { try {
System.out.println(response2.getStatusLine()); System.out.println(response2.getStatusLine());
@ -91,9 +89,8 @@ try {
// and ensure it is fully consumed // and ensure it is fully consumed
EntityUtils.consume(entity2); EntityUtils.consume(entity2);
} finally { } finally {
httpPost.releaseConnection(); response2.close();
} }
------------- -------------
Source can be downloaded Source can be downloaded