WebResourceLike interface
The legacy HTTP request description exposed by the _response field.
Properties
| abort |
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. |
| decompress |
Whether to decompress the response according to Accept-Encoding (node-fetch only). |
| form |
Form data used to build the request body. |
| headers | The HTTP headers to use. |
| keep |
Whether to reuse the connection. |
| method | The HTTP method to use. |
| on |
A callback that fires on download progress. |
| on |
A callback that fires on upload progress. |
| proxy |
Proxy configuration. |
| query | A query string represented as an object. |
| request |
A unique identifier for logging and tracing. |
| request |
Additional request options that override properties of the same name when sent. May contain Node.js HTTPS request options or browser RequestInit properties. |
| stream |
Whether the response body should be treated as a stream. |
| stream |
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. |
| with |
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. |
| validate |
Validate required request properties. A no-op for compatibility purposes. |
Property Details
abortSignal
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
keepAlive
Whether to reuse the connection.
keepAlive?: boolean
Property Value
boolean
method
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
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()
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()