public abstract class ApiRequest<T>
extends java.lang.Object
| Constructor and Description |
|---|
ApiRequest(java.lang.String url,
TransportClient client,
com.google.gson.Gson gson,
int retryAttempts,
java.lang.reflect.Type responseClass) |
| Modifier and Type | Method and Description |
|---|---|
ApiRequest<T> |
addHeader(org.apache.http.Header header) |
ApiRequest<T> |
addHeaders(java.util.List<org.apache.http.Header> headers) |
T |
execute() |
ClientResponse |
executeAsRaw() |
java.lang.String |
executeAsString() |
ClientResponse |
executeAsStringWithReturningFullInfo() |
ClientResponseTypeable<T> |
executeTypeable() |
ClientResponseTypeable<T> |
executeTypeableWithoutRetry() |
T |
executeWithoutRetry() |
protected abstract java.lang.String |
getBody() |
protected TransportClient |
getClient() |
java.lang.String |
getCookie(java.lang.String name) |
protected com.google.gson.Gson |
getGson() |
org.apache.http.Header[] |
getHeaders() |
protected abstract org.apache.http.Header[] |
getQueryHeaders() |
java.lang.reflect.Type |
getResponseClass() |
java.lang.String |
getUrl() |
ApiRequest<T> |
setCookie(java.lang.String name,
java.lang.String value) |
ApiRequest<T> |
setCookies(java.util.Map<java.lang.String,java.lang.String> entries) |
ApiRequest<T> |
setHeaders(org.apache.http.Header[] headers) |
ApiRequest<T> |
setHeaders(java.util.List<org.apache.http.Header> headers) |
public ApiRequest(java.lang.String url,
TransportClient client,
com.google.gson.Gson gson,
int retryAttempts,
java.lang.reflect.Type responseClass)
public ApiRequest<T> setCookie(java.lang.String name, java.lang.String value)
public ApiRequest<T> setCookies(java.util.Map<java.lang.String,java.lang.String> entries)
public java.lang.String getCookie(java.lang.String name)
public ApiRequest<T> setHeaders(org.apache.http.Header[] headers)
public ApiRequest<T> addHeader(org.apache.http.Header header)
public ApiRequest<T> addHeaders(java.util.List<org.apache.http.Header> headers)
public ApiRequest<T> setHeaders(java.util.List<org.apache.http.Header> headers)
public org.apache.http.Header[] getHeaders()
public java.lang.String getUrl()
protected com.google.gson.Gson getGson()
protected TransportClient getClient()
public java.lang.reflect.Type getResponseClass()
public T execute() throws ApiException, ClientException
ApiExceptionClientExceptionpublic ClientResponseTypeable<T> executeTypeable() throws ApiExtendedException, ClientException
ApiExtendedExceptionClientExceptionpublic T executeWithoutRetry() throws ClientException, ApiException
ClientExceptionApiExceptionpublic ClientResponseTypeable<T> executeTypeableWithoutRetry() throws ClientException, ApiExtendedException
ClientExceptionApiExtendedExceptionpublic ClientResponse executeAsStringWithReturningFullInfo() throws ClientException
ClientExceptionpublic java.lang.String executeAsString()
throws ClientException
ClientExceptionpublic ClientResponse executeAsRaw() throws ClientException
ClientExceptionprotected abstract java.lang.String getBody()
protected abstract org.apache.http.Header[] getQueryHeaders()