hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1434034 - in /httpcomponents/httpclient/trunk/src/site/apt: download.apt examples.apt quickstart.apt
Date Wed, 16 Jan 2013 16:52:43 GMT
Author: olegk
Date: Wed Jan 16 16:52:42 2013
New Revision: 1434034

URL: http://svn.apache.org/viewvc?rev=1434034&view=rev
Log:
Updated web site for HttpClient 4.3-alpha1 release

Modified:
    httpcomponents/httpclient/trunk/src/site/apt/download.apt
    httpcomponents/httpclient/trunk/src/site/apt/examples.apt
    httpcomponents/httpclient/trunk/src/site/apt/quickstart.apt

Modified: httpcomponents/httpclient/trunk/src/site/apt/download.apt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/src/site/apt/download.apt?rev=1434034&r1=1434033&r2=1434034&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/src/site/apt/download.apt (original)
+++ httpcomponents/httpclient/trunk/src/site/apt/download.apt Wed Jan 16 16:52:42 2013
@@ -42,46 +42,46 @@ HttpClient Downloads
     in your {{{http://maven.apache.org/guides/introduction/introduction-to-the-pom.html}pom.xml}}

     by adding the following block to the dependency descriptor:
 
-* {HttpComponents Client 4.2.1}
+* {HttpComponents Client 4.3 Alpha 1}
 
 -------------------------
   <dependency>
     <groupId>org.apache.httpcomponents</groupId>
     <artifactId>httpclient</artifactId>
-    <version>4.2.1</version>
+    <version>4.3-alpha1</version>
     <scope>compile</scope>
   </dependency>
 -------------------------
 
-* {HttpComponents HttpMime 4.2.1}
+* {HttpComponents HttpMime 4.3 Alpha 1}
 
 -------------------------
   <dependency>
     <groupId>org.apache.httpcomponents</groupId>
     <artifactId>httpmime</artifactId>
-    <version>4.2.1</version>
+    <version>4.3-alpha1</version>
     <scope>compile</scope>
   </dependency>
 -------------------------
 
-* {HttpComponents HttpClient Cache 4.2.1}
+* {HttpComponents HttpClient Cache 4.3 Alpha 1}
 
 -------------------------
   <dependency>
     <groupId>org.apache.httpcomponents</groupId>
     <artifactId>httpclient-cache</artifactId>
-    <version>4.2.1</version>
+    <version>4.3-alpha1</version>
     <scope>compile</scope>
   </dependency>
 -------------------------
 
-* {HttpComponents HttpClient Fluent 4.2.1}
+* {HttpComponents HttpClient Fluent 4.3 Alpha 1}
 
 -------------------------
   <dependency>
     <groupId>org.apache.httpcomponents</groupId>
     <artifactId>fluent-hc</artifactId>
-    <version>4.2.1</version>
+    <version>4.3-alpha1</version>
     <scope>compile</scope>
   </dependency>
 -------------------------

Modified: httpcomponents/httpclient/trunk/src/site/apt/examples.apt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/src/site/apt/examples.apt?rev=1434034&r1=1434033&r2=1434034&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/src/site/apt/examples.apt (original)
+++ httpcomponents/httpclient/trunk/src/site/apt/examples.apt Wed Jan 16 16:52:42 2013
@@ -44,6 +44,11 @@ HttpClient Examples
     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.
 
+    * {{{./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}}
     
     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 
     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}}
     
     This example shows how to execute requests enclosing a multipart encoded entity. 

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



Mime
View raw message