Headers
This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing.
A Headers object has an associated header list, which is initially
empty and consists of zero or more name and value pairs. You can add to this
using methods like append(). In all methods of this interface, header names
are matched by case-insensitive byte sequence.
Implements
Constructors
new Headers()
new Headers(init?): Headers
Parameters
| Parameter | Type |
|---|---|
init? | HeadersInit |
Returns
Methods
[iterator]()
[iterator](): IterableIterator<[string, string]>
Same as entries().
Returns
IterableIterator<[string, string]>
Implementation of
globalThis.Headers.[iterator]
append()
append(name, value): void
Parameters
| Parameter | Type |
|---|---|
name | string |
value | string |
Returns
void
Implementation of
globalThis.Headers.append
delete()
delete(name): void
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
void
Implementation of
globalThis.Headers.delete
entries()
entries(): IterableIterator<[string, string]>
Returns an iterator allowing to go through all key/value pairs contained in this object.
Returns
IterableIterator<[string, string]>
Implementation of
globalThis.Headers.entries
forEach()
forEach(callbackfn, thisArg?): void
Parameters
| Parameter | Type |
|---|---|
callbackfn | (value, key, parent) => void |
thisArg? | any |
Returns
void
Implementation of
globalThis.Headers.forEach
get()
get(name): null | string
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
null | string
Implementation of
globalThis.Headers.get
getSetCookie()
getSetCookie(): string[]
Returns
string[]
Implementation of
globalThis.Headers.getSetCookie
has()
has(name): boolean
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
boolean
Implementation of
globalThis.Headers.has
keys()
keys(): IterableIterator<string>
Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
Returns
IterableIterator<string>
Implementation of
globalThis.Headers.keys
set()
set(name, value): void
Parameters
| Parameter | Type |
|---|---|
name | string |
value | string |
Returns
void
Implementation of
globalThis.Headers.set
values()
values(): IterableIterator<string>
Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
Returns
IterableIterator<string>
Implementation of
globalThis.Headers.values