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](): HeadersIterator
<[string
, string
]>
Same as entries()
.
Returns
HeadersIterator
<[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(): HeadersIterator
<[string
, string
]>
Returns an iterator allowing to go through all key/value pairs contained in this object.
Returns
HeadersIterator
<[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(): HeadersIterator
<string
>
Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
Returns
HeadersIterator
<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(): HeadersIterator
<string
>
Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
Returns
HeadersIterator
<string
>
Implementation of
globalThis.Headers.values