Headers
interface
interface Headers extends DomIterable<string, string>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() (see Examples). In all methods of this interface, header names are matched by case-insensitive byte sequence.
variable
var 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() (see Examples). In all methods of this interface, header names are matched by case-insensitive byte sequence.
Constructors
constructor
new Headers(init?: HeadersInit): HeadersProperties
prototype
readonly prototype: HeadersMethods
append
append(name: string, value: string): voidAppends a new value onto an existing header inside a Headers object, or
adds the header if it does not already exist.
delete
delete(name: string): voidDeletes a header from a Headers object.
get
get(name: string): string | nullReturns a ByteString sequence of all the values of a header within a
Headers object with a given name.
has
has(name: string): booleanReturns a boolean stating whether a Headers object contains a certain
header.
set
set(name: string, value: string): voidSets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.
getSetCookie
getSetCookie(): string[]Returns an array containing the values of all Set-Cookie headers
associated with a response.