XHRRequest

Extended by


Properties

data?

optional data: string;

The data to send as the body of the request


headers?

optional headers: object;

Headers to send with the request. If specifying an array, multiple headers with the same name will be sent

Index signature

[key: string]: string | string[]


method?

optional method: string;

HTTP method, e.g. "POST". If omitted, GET is used


responseFormat?

optional responseFormat: SendXHRResponseFormat;

The desired format for the returned response body. Defaults to 'utf8'.

  • If 'utf8', the response body will be returned as a string.
  • If 'binary', the response body will be returned as a Uint8Array.

streamCallback()?

optional streamCallback: (chunk) => void;

For utf8 responses, you can have the result streamed to you for endpoints that support it.

Parameters

ParameterType
chunkstring

Returns

void


timeoutMs?

optional timeoutMs: number;

If specified, this request should time out after the given number of milliseconds


url

url: string;

URL to request