public interface RestClient
| Modifier and Type | Interface and Description |
|---|---|
static class |
RestClient.HttpVerb |
| Modifier and Type | Method and Description |
|---|---|
com.google.gson.JsonElement |
deleteRequest(String path)
Shortcut for
#requestJson for doing DELETE operation. |
com.google.gson.Gson |
getGson()
Returns Gson with optimal configuration for Gerrit REST API.
|
com.google.gson.JsonElement |
getRequest(String path)
Shortcut for
#requestJson for doing GET operation. |
com.google.gson.JsonElement |
postRequest(String path)
Shortcut for
#requestJson for doing POST operation. |
com.google.gson.JsonElement |
postRequest(String path,
String requestBody)
Shortcut for
#requestJson for doing POST operation with a request body. |
com.google.gson.JsonElement |
putRequest(String path)
Shortcut for
#requestJson for doing PUT operation. |
com.google.gson.JsonElement |
putRequest(String path,
String requestBody)
Shortcut for
#requestJson for doing PUT operation with a request body. |
org.apache.http.HttpResponse |
request(String path,
String requestBody,
RestClient.HttpVerb verb,
org.apache.http.Header... headers)
Executes a HTTP request and returns plain response.
|
com.google.gson.JsonElement |
requestJson(String path,
String requestBody,
RestClient.HttpVerb verb)
Executes a request and returns a JSON response.
|
org.apache.http.HttpResponse |
requestRest(String path,
String requestBody,
RestClient.HttpVerb verb)
Executes a request with Accept-header set to "application/json" and returns plain response.
|
com.google.gson.Gson getGson()
com.google.gson.JsonElement getRequest(String path) throws RestApiException
#requestJson for doing GET operation.RestApiExceptioncom.google.gson.JsonElement postRequest(String path) throws RestApiException
#requestJson for doing POST operation.RestApiExceptioncom.google.gson.JsonElement postRequest(String path, String requestBody) throws RestApiException
#requestJson for doing POST operation with a request body.RestApiExceptioncom.google.gson.JsonElement putRequest(String path) throws RestApiException
#requestJson for doing PUT operation.RestApiExceptioncom.google.gson.JsonElement putRequest(String path, String requestBody) throws RestApiException
#requestJson for doing PUT operation with a request body.RestApiExceptioncom.google.gson.JsonElement deleteRequest(String path) throws RestApiException
#requestJson for doing DELETE operation.RestApiExceptioncom.google.gson.JsonElement requestJson(String path, String requestBody, RestClient.HttpVerb verb) throws RestApiException
RestApiExceptionorg.apache.http.HttpResponse requestRest(String path, String requestBody, RestClient.HttpVerb verb) throws IOException, HttpStatusException
IOExceptionHttpStatusExceptionorg.apache.http.HttpResponse request(String path, String requestBody, RestClient.HttpVerb verb, org.apache.http.Header... headers) throws IOException, HttpStatusException
IOExceptionHttpStatusExceptionCopyright © 2018. All rights reserved.