public class GerritRestClient extends Object implements RestClient
RestClient.HttpVerb| Constructor and Description |
|---|
GerritRestClient(GerritAuthData authData,
HttpRequestExecutor httpRequestExecutor,
HttpClientBuilderExtension... httpClientBuilderExtensions) |
| 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.
|
public GerritRestClient(GerritAuthData authData, HttpRequestExecutor httpRequestExecutor, HttpClientBuilderExtension... httpClientBuilderExtensions)
public com.google.gson.Gson getGson()
RestClientgetGson in interface RestClientpublic com.google.gson.JsonElement getRequest(String path) throws RestApiException
RestClient#requestJson for doing GET operation.getRequest in interface RestClientRestApiExceptionpublic com.google.gson.JsonElement postRequest(String path) throws RestApiException
RestClient#requestJson for doing POST operation.postRequest in interface RestClientRestApiExceptionpublic com.google.gson.JsonElement postRequest(String path, String requestBody) throws RestApiException
RestClient#requestJson for doing POST operation with a request body.postRequest in interface RestClientRestApiExceptionpublic com.google.gson.JsonElement putRequest(String path) throws RestApiException
RestClient#requestJson for doing PUT operation.putRequest in interface RestClientRestApiExceptionpublic com.google.gson.JsonElement putRequest(String path, String requestBody) throws RestApiException
RestClient#requestJson for doing PUT operation with a request body.putRequest in interface RestClientRestApiExceptionpublic com.google.gson.JsonElement deleteRequest(String path) throws RestApiException
RestClient#requestJson for doing DELETE operation.deleteRequest in interface RestClientRestApiExceptionpublic com.google.gson.JsonElement requestJson(String path, String requestBody, RestClient.HttpVerb verb) throws RestApiException
RestClientrequestJson in interface RestClientRestApiExceptionpublic org.apache.http.HttpResponse requestRest(String path, String requestBody, RestClient.HttpVerb verb) throws IOException, HttpStatusException
RestClientrequestRest in interface RestClientIOExceptionHttpStatusExceptionpublic org.apache.http.HttpResponse request(String path, String requestBody, RestClient.HttpVerb verb, org.apache.http.Header... headers) throws IOException, HttpStatusException
RestClientrequest in interface RestClientIOExceptionHttpStatusExceptionCopyright © 2018. All rights reserved.