hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1030514 - /httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java
Date Wed, 03 Nov 2010 16:12:45 GMT
Author: olegk
Date: Wed Nov  3 16:12:45 2010
New Revision: 1030514

URL: http://svn.apache.org/viewvc?rev=1030514&view=rev
Log:
Removed reference to deprecated methods

Modified:
    httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java

Modified: httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java?rev=1030514&r1=1030513&r2=1030514&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java
(original)
+++ httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java
Wed Nov  3 16:12:45 2010
@@ -36,6 +36,7 @@ import org.apache.http.entity.mime.Multi
 import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.entity.mime.content.StringBody;
 import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.util.EntityUtils;
 
 /**
  * Example how to use multipart/form encoded POST request.
@@ -69,11 +70,8 @@ public class ClientMultipartFormPost {
         System.out.println(response.getStatusLine());
         if (resEntity != null) {
             System.out.println("Response content length: " + resEntity.getContentLength());
-            System.out.println("Chunked?: " + resEntity.isChunked());
-        }
-        if (resEntity != null) {
-            resEntity.consumeContent();
         }
+        EntityUtils.consume(resEntity);
     }
     
 }



Mime
View raw message