HttpHeaders
Http 头的不可变集合,惰性解析。
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
}
构造函数
Constructs a new HTTP header object with the given values. |
方法
检查是否存在指定名称的头。 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. | ||||||
参数
返回值
|
Sets a header value for a given name. If the header name already exists, its value is replaced with the given value. | ||||||
参数
返回值
|
Deletes all header values for a given name. | ||||||
参数
返回值
|