diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-07-21 15:05:42 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-07-21 15:05:50 +0200 |
commit | 6001978fe3aec946764e292c33cacb5eeb0d0004 (patch) | |
tree | 1fdad8af820d4bf51267287051419795b8618f08 /server | |
parent | b07f824fe45c5cea498c7170488b793c1f66e721 (diff) | |
download | sonarqube-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.java | 20 |
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; |