APIRequest <ResponseType>
Hierarchy
- APIRequest
Index
Properties
optionalreadonlyacceptsType
optionalreadonlyauthorization
readonlycachePolicy
optionalreadonlycontentType
optionalreadonlyheaders
readonlyhttpMethod
optionalreadonlyquery
Type declaration
[index string]: any
readonlytimeoutInterval
readonlyurl
Methods
optionalbody
Function to generate the HTTP request body.
Returns string
Data for the body, or
nilif no body is needed.
request
Composes a URLRequest for this object.
Parameters
forClient: APIClient
Returns any
Network instance for this API request.
send
Asynchronously sends the request to the given APIClient.
Parameters
toClient: APIClient
optionalparsingContext: APIParsingContext
Returns Promise<APIResponse<ResponseType>>
Response result of the request.
Abstract protocol defining the structure of an API request.
This intentionally defines the values and parameters that describes how to compose a request, without using the actual request object types from the platform. This is because often there are mutations or other metadata that need to be performed, or there might be multiple types of requests that perform similar functions, and need to be dealt with abstractly.
These request objects are converted into the appropriate request object type for the language in question at the time the request is performed in the APIClient.