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

133 lines
1.9 KiB
Plaintext

p.location-badge.
exported from <a href='../http'>angular2/http</a>
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/http/base_request_options.ts#L7-L54">angular2/src/http/base_request_options.ts (line 7)</a>
:markdown
Creates a request options object with default properties as described in the [Fetch
Spec](https://fetch.spec.whatwg.org/#requestinit) to be optionally provided when instantiating a
<a href='Request-class.html'><code>Request</code></a>. This class is used implicitly by <a href='Http-class.html'><code>Http</code></a> to merge in provided request
options with the default options specified here. These same default options are injectable via
the <a href='BaseRequestOptions-class.html'><code>BaseRequestOptions</code></a> class.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor({method, headers, body, mode, credentials, cache}?: IRequestOptions)
:markdown
.l-sub-section
h3 method
:markdown
Http method with which to execute the request.
Defaults to "GET".
.l-sub-section
h3 headers
:markdown
Headers object based on the `Headers` class in the [Fetch
Spec](https://fetch.spec.whatwg.org/#headers-class).
.l-sub-section
h3 body
:markdown
Body to be used when creating the request.
.l-sub-section
h3 mode
:markdown
.l-sub-section
h3 credentials
:markdown
.l-sub-section
h3 cache
:markdown
.l-sub-section
h3 merge
pre.prettyprint
code.
merge(opts?: IRequestOptions)
:markdown
Creates a copy of the `RequestOptions` instance, using the optional input as values to override
existing values.