Author: sebb
Date: Mon Oct  6 04:51:44 2008
New Revision: 702113

URL: http://svn.apache.org/viewvc?rev=702113&view=rev
Log:
Rename postBody => putBody to avoid confusion

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

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PutWriter.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PutWriter.java?rev=702113&r1=702112&r2=702113&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PutWriter.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PutWriter.java
 Mon Oct  6 04:51:44 2008
@@ -58,8 +58,7 @@
         HTTPFileArg files[] = sampler.getHTTPFiles();
 
         // If there are no arguments, we can send a file as the body of the 
request
-        // TODO: needs a multiple file upload scenerio
-        if(sampler.getArguments() != null && 
sampler.getArguments().getArgumentCount() == 0 && 
sampler.getSendFileAsPostBody()) {
+         if(sampler.getArguments() != null && 
sampler.getArguments().getArgumentCount() == 0 && 
sampler.getSendFileAsPostBody()) {
             // If getSendFileAsPostBody returned true, it's sure that file is 
not null
             HTTPFileArg file = files[0];
             hasPutBody = true;
@@ -79,7 +78,6 @@
             // Allow the mimetype of the file to control the content type
             // This is not obvious in GUI if you are not uploading any files,
             // but just sending the content of nameless parameters
-            // TODO: needs a multiple file upload scenerio
             if(!hasContentTypeHeader && files.length == 1 && 
files[0].getMimeType().length() > 0) {
                 
connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, 
files[0].getMimeType());
             }
@@ -88,16 +86,14 @@
             ByteArrayOutputStream bos = new ByteArrayOutputStream();
 
             // Just append all the parameter values, and use that as the put 
body
-            StringBuffer postBodyBuffer = new StringBuffer();
+            StringBuffer putBodyBuffer = new StringBuffer();
             PropertyIterator args = sampler.getArguments().iterator();
             while (args.hasNext()) {
                 HTTPArgument arg = (HTTPArgument) args.next().getObjectValue();
-                postBodyBuffer.append(arg.getEncodedValue(contentEncoding));
+                putBodyBuffer.append(arg.getEncodedValue(contentEncoding));
             }
-            String postBody = postBodyBuffer.toString();
 
-            // Query string should be encoded in UTF-8
-            bos.write(postBody.getBytes("UTF-8")); // $NON-NLS-1$
+            bos.write(putBodyBuffer.toString().getBytes(contentEncoding));
             bos.flush();
             bos.close();
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to