aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-07-21 15:05:42 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-07-21 15:05:50 +0200
commit6001978fe3aec946764e292c33cacb5eeb0d0004 (patch)
tree1fdad8af820d4bf51267287051419795b8618f08 /server
parentb07f824fe45c5cea498c7170488b793c1f66e721 (diff)
downloadsonarqube-6001978fe3aec946764e292c33cacb5eeb0d0004.tar.gz
sonarqube-6001978fe3aec946764e292c33cacb5eeb0d0004.zip
SONAR-5383 Add WS client methods to do raw WS calls (url+params -> string)
Diffstat (limited to 'server')
-rw-r--r--server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java
index 0a7275151b2..06ae374c2d7 100644
--- a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java
+++ b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java
@@ -39,6 +39,8 @@ import org.sonar.wsclient.user.internal.DefaultUserClient;
import javax.annotation.Nullable;
+import java.util.Map;
+
/**
* Entry point of the Java Client for Sonar Web Services. It does not support all web services yet.
* <p/>
@@ -140,6 +142,24 @@ public class SonarClient {
return builder().url(serverUrl).build();
}
+ /**
+ * Send a POST request on the given relativeUrl, with provided parameters (can be empty)
+ * @since 4.5
+ * @return the response body
+ */
+ public String post(String relativeUrl, Map<String, Object> params) {
+ return requestFactory.post(relativeUrl, params);
+ }
+
+ /**
+ * Send a GET request on the given relativeUrl, with provided parameters (can be empty)
+ * @since 4.5
+ * @return the response body
+ */
+ public String get(String relativeUrl, Map<String, Object> params) {
+ return requestFactory.get(relativeUrl, params);
+ }
+
public static class Builder {
private String login, password, url, proxyHost, proxyLogin, proxyPassword;
private int proxyPort = 0;