Request
Extends
Body
Implements
Constructors
new Request()
new Request(input
, init
): Request
Parameters
Parameter | Type |
---|---|
input | string | URL | Request |
init | RequestInit |
Returns
Overrides
Body.constructor
Properties
Property | Type | Inherited from |
---|---|---|
body | null | ReadableStream <Uint8Array > | globalThis.Request.body Body.body |
bodyUsed | boolean | globalThis.Request.bodyUsed Body.bodyUsed |
cache | RequestCache | - |
credentials | RequestCredentials | - |
destination | RequestDestination | - |
headers | Headers | globalThis.Request.headers Body.headers |
integrity | string | - |
keepalive | boolean | - |
method | string | - |
mode | RequestMode | - |
redirect | RequestRedirect | - |
referrer | string | - |
referrerPolicy | ReferrerPolicy | - |
signal | AbortSignal | - |
url | string | - |
Methods
arrayBuffer()
arrayBuffer(): Promise
<ArrayBuffer
>
Returns a promise that resolves with an ArrayBuffer representation of the body. If the body is null, it returns an empty ArrayBuffer.
Returns
Implementation of
globalThis.Request.arrayBuffer
Inherited from
Body.arrayBuffer
blob()
Returns a promise that resolves with a Blob representation of the body. The Blob's type will be the value of the 'content-type' header.
Returns
Implementation of
globalThis.Request.blob
Inherited from
Body.blob
clone()
clone(): Request
Returns
Implementation of
globalThis.Request.clone
formData()
Returns a promise that resolves with a FormData representation of the body.
If the body cannot be decoded as form data, it throws a TypeError
.
Returns
Implementation of
globalThis.Request.formData
Inherited from
Body.formData
json()
json(): Promise
<any
>
Returns a promise that resolves with a JSON representation of the body.
If the body cannot be parsed as JSON, it throws a SyntaxError
.
Returns
Promise
<any
>
Implementation of
globalThis.Request.json
Inherited from
Body.json
text()
text(): Promise
<string
>
Returns a promise that resolves with a text representation of the body.
Returns
Promise
<string
>
Implementation of
globalThis.Request.text
Inherited from
Body.text