Package version:

Interface WebResourceLike

A description of a HTTP request to be made to a remote server.

interface WebResourceLike {
    abortSignal?: any;
    body?: any;
    decompressResponse?: boolean;
    formData?: any;
    headers: HttpHeadersLike;
    keepAlive?: boolean;
    method: HttpMethods;
    onDownloadProgress?: ((progress) => void);
    onUploadProgress?: ((progress) => void);
    proxySettings?: any;
    query?: {
        [key: string]: any;
    };
    requestId: string;
    streamResponseBody?: boolean;
    streamResponseStatusCodes?: Set<number>;
    timeout: number;
    url: string;
    withCredentials: boolean;
}

Properties

abortSignal?: any

Signal of an abort controller. Can be used to abort both sending a network request and waiting for a response.

body?: any

The HTTP body contents of the request.

decompressResponse?: boolean

Whether or not to decompress response according to Accept-Encoding header (node-fetch only)

formData?: any

Form data, used to build the request body.

The HTTP headers to use when making the request.

keepAlive?: boolean

If the connection should be reused.

method: HttpMethods

The HTTP method to use when making the request.

onDownloadProgress?: ((progress) => void)

Callback which fires upon download progress.

Type declaration

    • (progress): void
    • Callback which fires upon download progress.

      Parameters

      Returns void

onUploadProgress?: ((progress) => void)

Callback which fires upon upload progress.

Type declaration

    • (progress): void
    • Callback which fires upon upload progress.

      Parameters

      Returns void

proxySettings?: any

Proxy configuration.

query?: {
    [key: string]: any;
}

A query string represented as an object.

Type declaration

  • [key: string]: any
requestId: string

A unique identifier for the request. Used for logging and tracing.

streamResponseBody?: boolean

Whether or not the body of the HttpOperationResponse should be treated as a stream.

Deprecated

Use streamResponseStatusCodes property instead.

streamResponseStatusCodes?: Set<number>

A list of response status codes whose corresponding HttpOperationResponse body should be treated as a stream.

timeout: number

The number of milliseconds a request can take before automatically being terminated. If the request is terminated, an AbortError is thrown.

url: string

The URL being accessed by the request.

withCredentials: boolean

If credentials (cookies) should be sent along during an XHR.

Generated using TypeDoc