svn commit: r676206 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpClient.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r676206 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpClient.java

adrianc
Author: adrianc
Date: Sat Jul 12 10:52:04 2008
New Revision: 676206

URL: http://svn.apache.org/viewvc?rev=676206&view=rev
Log:
Some minor improvements to the HttpClient class.

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpClient.java

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpClient.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpClient.java?rev=676206&r1=676205&r2=676206&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpClient.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpClient.java Sat Jul 12 10:52:04 2008
@@ -26,11 +26,9 @@
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
+import java.security.cert.CertificateException;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
-import java.security.cert.CertificateException;
 
 /**
  * Send HTTP GET/POST requests.
@@ -326,7 +324,7 @@
         }
     }
 
-    private String sendHttpRequest(String method) throws HttpClientException {
+    public String sendHttpRequest(String method) throws HttpClientException {
         InputStream in = sendHttpRequestStream(method);
         if (in == null) return null;
 
@@ -407,7 +405,11 @@
 
         // Append the arguments to the query string if GET.
         if (method.equalsIgnoreCase("get") && arguments != null) {
-            url = url + "?" + arguments;
+            if (url.contains("?")) {
+                url = url + "&" + arguments;
+            } else {
+                url = url + "?" + arguments;
+            }
         }
 
         // Create the URL and open the connection.