WebResourceLike interface

The legacy HTTP request description exposed by the _response field.

Properties

abortSignal

A signal that can abort the request.

agent

A custom HTTP or HTTPS agent shared between requests. Only used in Node.js.

body

The HTTP body contents of the request.

decompressResponse

Whether to decompress the response according to Accept-Encoding (node-fetch only).

formData

Form data used to build the request body.

headers

The HTTP headers to use.

keepAlive

Whether to reuse the connection.

method

The HTTP method to use.

onDownloadProgress

A callback that fires on download progress.

onUploadProgress

A callback that fires on upload progress.

proxySettings

Proxy configuration.

query

A query string represented as an object.

requestId

A unique identifier for logging and tracing.

requestOverrides

Additional request options that override properties of the same name when sent. May contain Node.js HTTPS request options or browser RequestInit properties.

streamResponseBody

Whether the response body should be treated as a stream.

streamResponseStatusCodes

Response status codes whose bodies should be treated as streams.

timeout

The number of milliseconds before a request is automatically terminated.

url

The URL being accessed by the request.

withCredentials

Whether to send credentials (cookies) during an XHR.

Methods

clone()

Clone this request object.

prepare(unknown)

A legacy preparation method that throws when called on a compatibility request.

validateRequestProperties()

Validate required request properties. A no-op for compatibility purposes.

Property Details

abortSignal

A signal that can abort the request.

abortSignal?: AbortSignalLike

Property Value

agent

A custom HTTP or HTTPS agent shared between requests. Only used in Node.js.

agent?: Agent

Property Value

body

The HTTP body contents of the request.

body?: any

Property Value

any

decompressResponse

Whether to decompress the response according to Accept-Encoding (node-fetch only).

decompressResponse?: boolean

Property Value

boolean

formData

Form data used to build the request body.

formData?: any

Property Value

any

headers

The HTTP headers to use.

headers: HttpHeadersLike

Property Value

keepAlive

Whether to reuse the connection.

keepAlive?: boolean

Property Value

boolean

method

The HTTP method to use.

method: HttpMethods

Property Value

onDownloadProgress

A callback that fires on download progress.

onDownloadProgress?: (progress: TransferProgressEvent) => void

Property Value

(progress: TransferProgressEvent) => void

onUploadProgress

A callback that fires on upload progress.

onUploadProgress?: (progress: TransferProgressEvent) => void

Property Value

(progress: TransferProgressEvent) => void

proxySettings

Proxy configuration.

proxySettings?: ProxySettings

Property Value

query

A query string represented as an object.

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

Property Value

{[key: string]: any}

requestId

A unique identifier for logging and tracing.

requestId: string

Property Value

string

requestOverrides

Additional request options that override properties of the same name when sent. May contain Node.js HTTPS request options or browser RequestInit properties.

requestOverrides?: Record<string, unknown>

Property Value

Record<string, unknown>

streamResponseBody

Warning

This API is now deprecated.

Use streamResponseStatusCodes instead.

Whether the response body should be treated as a stream.

streamResponseBody?: boolean

Property Value

boolean

streamResponseStatusCodes

Response status codes whose bodies should be treated as streams.

streamResponseStatusCodes?: Set<number>

Property Value

Set<number>

timeout

The number of milliseconds before a request is automatically terminated.

timeout: number

Property Value

number

url

The URL being accessed by the request.

url: string

Property Value

string

withCredentials

Whether to send credentials (cookies) during an XHR.

withCredentials: boolean

Property Value

boolean

Method Details

clone()

Clone this request object.

function clone(): WebResourceLike

Returns

prepare(unknown)

A legacy preparation method that throws when called on a compatibility request.

function prepare(options: unknown): WebResourceLike

Parameters

options

unknown

Request preparation options.

Returns

validateRequestProperties()

Validate required request properties. A no-op for compatibility purposes.

function validateRequestProperties()