Fetch
Module:whatwg.fetch
Support: Experimental
Type Aliases
HeadersInitXMLHttpRequestBodyInitBodyInitRequestInfo
Interface Headers
Represents HTTP headers as a case-insensitive multimap, with methods to append, retrieve, and iterate over header name-value pairs.
Since: 1.1.0 Docs: WHATWG Docs8 members: 8 undocumented
Constructors
Methods
Iterators
---
Mixin Body
Mixin providing body-reading methods for Request and Response.
Since: 1.1.0 Docs: WHATWG Docs8 members: 8 undocumented
Methods
Properties
---
Enum RequestDestination
Indicates the type of resource being fetched, influencing content security and caching behavior.
Since: 1.1.0 Docs: WHATWG Docs| Value | Description |
|---|---|
| `` | |
audio | |
audioworklet | |
document | |
embed | |
font | |
frame | |
iframe | |
image | |
json | |
manifest | |
object | |
paintworklet | |
report | |
script | |
sharedworker | |
style | |
track | |
video | |
worker | |
xslt |
Enum RequestMode
The CORS mode for a fetch request, controlling cross-origin behavior.
Since: 1.1.0 Docs: WHATWG Docs| Value | Description |
|---|---|
navigate | |
same-origin | |
no-cors | |
cors |
Enum RequestCredentials
Controls whether cookies and other credentials are sent with the request.
Since: 1.1.0 Docs: WHATWG Docs| Value | Description |
|---|---|
omit | |
same-origin | |
include |
Enum RequestCache
Determines how the request interacts with the browser's HTTP cache.
Since: 1.1.0 Docs: WHATWG Docs| Value | Description |
|---|---|
default | |
no-store | |
reload | |
no-cache | |
force-cache | |
only-if-cached |
Enum RequestRedirect
Controls how HTTP redirects are handled: follow them, reject them, or expose them manually.
Since: 1.1.0 Docs: WHATWG Docs| Value | Description |
|---|---|
follow | |
error | |
manual |
Enum RequestDuplex
Controls duplex mode for streaming request bodies; "half" means the request body
can be sent before the response is received.
| Value | Description |
|---|---|
half |
Enum RequestPriority
A priority hint indicating the relative importance of this fetch compared to others.
Since: 1.1.0 Docs: WHATWG Docs| Value | Description |
|---|---|
high | |
low | |
auto |
Interface Request
Implements: Body
16 members: 16 undocumented
Constructors
Methods
Properties
---
Dictionary RequestInit
14 members: 14 undocumented
Properties
---
Enum ResponseType
Classifies the response origin and filtering applied by the Fetch algorithm.
Since: 1.1.0 Docs: WHATWG Docs| Value | Description |
|---|---|
basic | |
cors | |
default | |
error | |
opaque | |
opaqueredirect |
Interface Response
Represents an HTTP response with status, headers, and body, including static factory methods for common patterns like redirects, JSON responses, and errors.
Implements: Body Since: 1.1.0 Docs: WHATWG Docs12 members: 12 undocumented
Constructors
Static Methods
Methods
Properties
---
Dictionary ResponseInit
3 members: 3 undocumented
Properties
---