Class “Response”

Object > Response

Represents an HTTP Response as used by fetch().

Type: Response extends Object
Constructor: public
Singleton: No
Namespace: global
Direct subclasses: None
JSX Support: No

Constructor

new Response(body?, init?)

Parameter Type Description
body Blob
| FormData
| string
Optional.
init object Optional.
init.headers Headers
| Array<[string, string]>
| {[header]: string}
Optional.
init.status number Optional.
init.statusText string Optional.

Methods

arrayBuffer()

Returns: Promise<ArrayBuffer>

blob()

Returns: Promise<Blob>

clone()

Returns: Response

json()

Returns: Promise</code>

text()

Returns: Promise<string>

Properties

bodyUsed

Type: boolean
Settable: No

headers

Type: Headers
Settable: No

ok

Type: boolean
Settable: No

status

Type: number
Settable: No

statusText

Type: string
Settable: No

type

Type: 'basic' | 'cors' | 'default' | 'error' | 'opaque'
Settable: No

url

Type: string
Settable: No