SendXHRQuery

type SendXHRQuery: object;

Type declaration

d?

optional d: string;

The data to send with the request.

For GET requests, this specifies the query string.

For non-GET requests, this is sent as the body of the request. If this is specified, and
no 'Content-Type' header is specified, a 'text/plain; charset=utf-8' content type is sent.

f?

optional f: 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.

h?

optional h: object;

Headers to send with the request

Index signature

[key: string]: string | string[]

m?

optional m: string;

HTTP method, e.g. 'GET', 'FETCH', etc. Defaults to GET

ms?

optional ms: number;

Timeout in milliseconds, if specified

s?

optional s: string;

If set, a callback to call with chunks of the response as they arrive.
Only valid for utf8 (text) requests, and only called on successful responses.
The full final response will still be returned as normal.

url

url: string;