HttpHeaders
Http 头的不可变集合,惰性解析。
Represents the header configuration options for an HTTP request. Instances are immutable. Modifying methods return a cloned instance with the change. The original object is never changed.
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 given header. |
返回匹配指定名称的第一个头的值。 Retrieves the first value of a given header. |
返回所有的头名称。 Retrieves the names of the headers. |
参数没有参数。 返回值一个头名称列表。
|
返回头中具有指定名称的值的列表。 Retrieves a list of values for a given header. |
Appends a new value to the existing set of values for a header and returns them in a clone of the original instance. | ||||||
参数
返回值
|
Sets or modifies a value for a given header in a clone of the original instance. If the header already exists, its value is replaced with the given value in the returned object. | ||||||
参数
返回值
|
Deletes values for a given header in a clone of the original instance. | ||||||
参数
返回值
|