jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1351008 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Date Sat, 16 Jun 2012 21:14:37 GMT
Author: pmouawad
Date: Sat Jun 16 21:14:36 2012
New Revision: 1351008

URL: http://svn.apache.org/viewvc?rev=1351008&view=rev
Log:
Replace deprecated code

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1351008&r1=1351007&r2=1351008&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Sat Jun 16 21:14:36 2012
@@ -920,7 +920,9 @@ public class HTTPHC4Impl extends HTTPHCA
                         }
                         postBody.append(value);
                     }
-                    StringEntity requestEntity = new StringEntity(postBody.toString(), post.getFirstHeader(HEADER_CONTENT_TYPE).getValue(),
contentEncoding);
+                    ContentType contentType = 
+                            ContentType.create(post.getFirstHeader(HEADER_CONTENT_TYPE).getValue(),
contentEncoding);
+                    StringEntity requestEntity = new StringEntity(postBody.toString(), contentType);
                     post.setEntity(requestEntity);
                     postedBody.append(postBody.toString()); // TODO OK?
                 } else {
@@ -1057,7 +1059,9 @@ public class HTTPHC4Impl extends HTTPHCA
             if(hasContentTypeHeader) {
                 contentTypeValue = put.getFirstHeader(HEADER_CONTENT_TYPE).getValue();
             }
-            StringEntity requestEntity = new StringEntity(putBodyContent.toString(), contentTypeValue,
charset);
+            ContentType contentType = 
+                    ContentType.create(contentTypeValue, charset);
+            StringEntity requestEntity = new StringEntity(putBodyContent.toString(), contentType);
             put.setEntity(requestEntity);
         }
         // Check if we have any content to send for body



Mime
View raw message