angular-cn/public/docs/js/latest/api/http/Headers-class.jade

193 lines
2.5 KiB
Plaintext

p.location-badge.
exported from <a href='../http'>angular2/http</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/http/headers.ts#L9-L103">angular2/src/http/headers.ts (line 9)</a>
:markdown
Polyfill for [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers/Headers), as
specified in the [Fetch Spec](https://fetch.spec.whatwg.org/#headers-class). The only known
difference from the spec is the lack of an `entries` method.
.l-main-section
h2 Members
.l-sub-section
h3#constructor constructor
pre.prettyprint
code.
constructor(headers?: Headers | StringMap&lt;string, any&gt;)
:markdown
.l-sub-section
h3#append append
pre.prettyprint
code.
append(name: string, value: string)
:markdown
Appends a header to existing list of header values for a given header name.
.l-sub-section
h3#delete delete
pre.prettyprint
code.
delete(name: string)
:markdown
Deletes all header values for the given name.
.l-sub-section
h3#forEach forEach
pre.prettyprint
code.
forEach(fn: Function)
:markdown
.l-sub-section
h3#get get
pre.prettyprint
code.
get(header: string)
:markdown
Returns first header that matches given name.
.l-sub-section
h3#has has
pre.prettyprint
code.
has(header: string)
:markdown
Check for existence of header by given name.
.l-sub-section
h3#keys keys
pre.prettyprint
code.
keys()
:markdown
Provides names of set headers
.l-sub-section
h3#set set
pre.prettyprint
code.
set(header: string, value: string | string[])
:markdown
Sets or overrides header value for given name.
.l-sub-section
h3#values values
pre.prettyprint
code.
values()
:markdown
Returns values of all headers.
.l-sub-section
h3#getAll getAll
pre.prettyprint
code.
getAll(header: string)
:markdown
Returns list of header values for a given name.
.l-sub-section
h3#entries entries
pre.prettyprint
code.
entries()
:markdown
This method is not implemented.