Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Request

Encapsulates the information used by {@link Adapter Adapters} to complete a data call.

WARNING: Do not construct a Request object manually. Instead, pass a {@link DataDefinition} object to {@link DataLayer.createRequest createRequest()} directly.

IMPORTANT: The Request object is frozen. Any attempt to modify existing Request values will result in an Error. If you need to modify a Request as part of a data pipeline, use cloneDeep (or similar) to make a copy of the Request that can be safely modified.

Hierarchy

  • DataDefinition
    • Request

Index

Properties

adapter?: string

The adapter to use to complete the request.

default

'default'

base?: string

Used in conjunction with {@link ProxyRule ProxyRules} to determine the domain name for the resulting Request URL. If an empty string is provided then a relative URL (one without a protocol or domain name) will be created using the existing domain name and protocol.

body?: any

An optional payload to send to the URL, set when calling {@link DataLayer.createRequest createRequest()}.

default

null

headers?: Record<string, string | string[]>

The HTTP headers to use on the request.

default

{ accept: 'application/json, text/plain, ⁎/⁎' }

ignore?: Record<string, boolean>

Can be used to skip certain behaviors. See documentation for details.

method?: string

The HTTP verb to use.

default

'GET'

path?: string

Combined with the base path (if provided) to construct an absolute or relative URL.

responseType?: XMLHttpRequestResponseType

The desired response type. Can be one of '' (the default), 'text', 'json', 'arraybuffer', 'blob' or 'document'. See the XHR spec for more information. Setting this will change the Response.data type.

timeout?: number

The number of milliseconds to wait before aborting the data call.

default

0 - no timeout

url?: string

The URL to open, constructed using {@link DataProxy.url Proxy.url()} and any {@link ProxyRule ProxyRules} that match the given Request properties as well as any optional parameters passed to {@link DataLayer.createRequest createRequest()}.

withCredentials?: boolean

Whether to send Cookies with the request.

default

false