Author: rgardler
Date: Thu Jul 29 21:50:22 2010
New Revision: 980593

URL: http://svn.apache.org/viewvc?rev=980593&view=rev
Log:
Enable posting of XML in the body of an HTTP request. Fixes WOOKIE-148, Thanks 
to Sander van der Waal

Modified:
    incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java

Modified: incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java?rev=980593&r1=980592&r2=980593&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java 
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java Thu Jul 
29 21:50:22 2010
@@ -94,8 +94,13 @@ public class ProxyClient {
                fLogger.debug("POST to " + uri); //$NON-NLS-1$
                PostMethod method = new PostMethod(uri);
                method.setDoAuthentication(true);
-               method.setRequestEntity(new StringRequestEntity(xmlData, 
"text/xml", "UTF8"));//$NON-NLS-1$  //$NON-NLS-2$
-               method.addParameters(this.parameters);
+               
+               if(this.parameters.length > 0) {
+                       method.addParameters(this.parameters);
+               } else {
+                       method.setRequestEntity(new 
StringRequestEntity(xmlData, "text/xml", "UTF8"));//$NON-NLS-1$  //$NON-NLS-2$
+               }
+               
                return executeMethod(method, properties);
        }
 


Reply via email to