ApiRequest

Utility class to create HTTPClientRequests to access the REST API.

Constructors

this
this(HTTPMethod method, string serverUrl, string pathUrl)

Constructs a new ApiRequest.

Members

Functions

getUrl
string getUrl()

Return the URL of an API Request, resolving any path and query-string parameters.

makeRequest
void makeRequest(RequestT reqBody, ResponseHandler handler)

Asynchronously perform the network request for an API Request, resolving cookie and header parameters, and transmitting the request body.

setHeaderParam
void setHeaderParam(string key, string value)
void setHeaderParam(string key, Nullable!T value)

Adds a header parameter and value to the request.

setPathParam
void setPathParam(string key, string value)
void setPathParam(string key, Nullable!T value)

URL-encode a value to add as a path parameter.

setQueryParam
void setQueryParam(string key, string value)
void setQueryParam(string key, T value)
void setQueryParam(string keyPrefix, T obj)

URL-encode a value to add as a query-string parameter.

Variables

headerParams
string[string] headerParams;

A mapping from header parameter names to their values.

method
HTTPMethod method;

The HTTP Method to use for the request, e.g. "GET", "POST", "PUT", etc.

pathParams
string[string] pathParams;

A mapping from path-parameter names to their values.

pathUrl
string pathUrl;

The path for the specific endpoint. It may include named parameters contained within curley braces, e.g. "{param}".

queryParams
string[string] queryParams;

A mapping from query-string parameter names to their values.

serverUrl
string serverUrl;

The base-part of the URL including the schema, host, and base path.

Meta