Interface VMScriptGMXHRDetails<T>

interface VMScriptGMXHRDetails<T> {
    anonymous?: boolean;
    binary?: boolean;
    context?: unknown;
    data?: string | ArrayBuffer | DataView | Blob | FormData | URLSearchParams | ReadableStream<any> | TypedArray;
    headers?: Record<string, string>;
    method?: string;
    onabort?: ((resp) => void);
    onerror?: ((resp) => void);
    onload?: ((resp) => void);
    onloadend?: ((resp) => void);
    onloadstart?: ((resp) => void);
    onprogress?: ((resp) => void);
    onreadystatechange?: ((resp) => void);
    ontimeout?: ((resp) => void);
    overrideMimeType?: string;
    password?: string;
    responseType?: VMScriptResponseType;
    timeout?: number;
    url: string;
    user?: string;
}

Type Parameters

  • T

Hierarchy (view full)

Properties

anonymous?: boolean

When set to true, no cookie will be sent with the request and the response cookies will be ignored. The default value is false.

binary?: boolean

Send the data string as a blob. This is for compatibility with Tampermonkey/Greasemonkey, where only string type is allowed in data.

context?: unknown

Can be an object and will be assigned to context of the response object.

data?: string | ArrayBuffer | DataView | Blob | FormData | URLSearchParams | ReadableStream<any> | TypedArray

Data to send with the request, usually for POST and PUT requests.

headers?: Record<string, string>

Some special headers are also allowed:

  • Cookie
  • Host
  • Origin
  • Referer
  • User-Agent
method?: string

HTTP method, default as GET.

onabort?: ((resp) => void)

Type declaration

onerror?: ((resp) => void)

Type declaration

onload?: ((resp) => void)

Type declaration

onloadend?: ((resp) => void)

Type declaration

onloadstart?: ((resp) => void)

Type declaration

onprogress?: ((resp) => void)

Type declaration

onreadystatechange?: ((resp) => void)

Type declaration

ontimeout?: ((resp) => void)

Type declaration

overrideMimeType?: string

A MIME type to specify with the request.

password?: string

Password for authentication.

responseType?: VMScriptResponseType

One of the following:

  • text (default value)
  • json
  • blob
  • arraybuffer
  • document
timeout?: number

Time to wait for the request, none by default.

url: string

URL relative to current page is also allowed.

user?: string

User for authentication.