public abstract class BaseRequest extends java.lang.Object implements IHttpRequest
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
REQUEST_STATS_HEADER_VALUE_FORMAT_STRING
The request stats header value format string.
|
| Constructor and Description |
|---|
BaseRequest(java.lang.String requestUrl,
IOneDriveClient client,
java.util.List<Option> options,
java.lang.Class responseClass)
Create the request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(java.lang.String header,
java.lang.String value)
Adds a header to this request.
|
IOneDriveClient |
getClient()
Gets the client.
|
java.util.List<HeaderOption> |
getHeaders()
Gets the headers.
|
HttpMethod |
getHttpMethod()
Gets the http method.
|
java.util.List<Option> |
getOptions()
Gets the full list of options for this request.
|
java.util.List<QueryOption> |
getQueryOptions()
Gets the query options for this request.
|
java.net.URL |
getRequestUrl()
Gets the request url.
|
java.lang.Class |
getResponseType()
Gets the response type.
|
protected <T1,T2> void |
send(HttpMethod method,
ICallback<T1> callback,
T2 serializedObject)
Sends this request.
|
protected <T1,T2> T1 |
send(HttpMethod method,
T2 serializedObject)
Sends this request.
|
void |
setHttpMethod(HttpMethod httpMethod)
Sets the http method.
|
public static final java.lang.String REQUEST_STATS_HEADER_VALUE_FORMAT_STRING
public BaseRequest(java.lang.String requestUrl,
IOneDriveClient client,
java.util.List<Option> options,
java.lang.Class responseClass)
requestUrl - The url to make the request against.client - The client which can issue the request.options - The options for this request.responseClass - The class for the response.public java.net.URL getRequestUrl()
getRequestUrl in interface IHttpRequestpublic HttpMethod getHttpMethod()
getHttpMethod in interface IHttpRequestpublic java.util.List<HeaderOption> getHeaders()
getHeaders in interface IHttpRequestpublic void addHeader(java.lang.String header,
java.lang.String value)
addHeader in interface IHttpRequestheader - The name of the header.value - The value of the header.protected <T1,T2> void send(HttpMethod method, ICallback<T1> callback, T2 serializedObject)
T1 - The type of the callback result.T2 - The type of the serialized body.method - The http method.callback - The callback when this request complements.serializedObject - The object to serialize as the body.protected <T1,T2> T1 send(HttpMethod method, T2 serializedObject) throws ClientException
T1 - The type of the callback result.T2 - The type of the serialized body.method - The http method.serializedObject - The object to serialize as the body.ClientException - An exception occurs if there was an error while the request was sent.public java.util.List<QueryOption> getQueryOptions()
public java.util.List<Option> getOptions()
getOptions in interface IHttpRequestpublic void setHttpMethod(HttpMethod httpMethod)
httpMethod - The http method.public IOneDriveClient getClient()
public java.lang.Class getResponseType()