HttpHeaders
HttpHeaders
class represents the header configuration options for an HTTP request.
Instances should be assumed immutable with lazy parsing.
class HttpHeaders {
constructor(headers?: string | { [name: string]: string | string[]; })
has(name: string): boolean
get(name: string): string | null
keys(): string[]
getAll(name: string): string[] | null
append(name: string, value: string | string[]): HttpHeaders
set(name: string, value: string | string[]): HttpHeaders
delete(name: string, value?: string | string[]): HttpHeaders
}
Constructor
Constructs a new HTTP header object with the given values. |
Methods
Checks for existence of a header by a given name. |
Returns the first header value that matches a given name. |
Returns the names of the headers. |
Returns a list of header values for a given header name. |
Appends a new header value to the existing set of header values. |
||||||
Parameters
Returns
|
Sets a header value for a given name. If the header name already exists, its value is replaced with the given value. |
||||||
Parameters
Returns
|
Deletes all header values for a given name. |
||||||
Parameters
Returns
|