Skip to main content

APIRequest <ResponseType>

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.

Hierarchy

Index

Properties

optionalreadonlyacceptsType

acceptsType?: string

optionalreadonlyauthorization

authorization?: APIAuthorization

readonlycachePolicy

cachePolicy: HTTPCachePolicy

optionalreadonlycontentType

contentType?: string

optionalreadonlyheaders

headers?: [String: any]

readonlyhttpMethod

httpMethod: HTTPMethod

optionalreadonlyquery

query?: {}

Type declaration

  • [index string]: any

readonlytimeoutInterval

timeoutInterval: Number

readonlyurl

url: URL

Methods

optionalbody

  • body(): string
  • Function to generate the HTTP request body.

    @throws

    Error if the body could not be generated.


    Returns string

    Data for the body, or nil if no body is needed.

request

  • Composes a URLRequest for this object.


    Parameters

    Returns any

    Network instance for this API request.

send