diff --git a/aio/package.json b/aio/package.json index b8cdcaff5f..eac0d405fe 100644 --- a/aio/package.json +++ b/aio/package.json @@ -84,6 +84,7 @@ "@angular/router": "6.0.0", "@angular/service-worker": "^1.0.0-beta.16", "@webcomponents/custom-elements": "^1.0.8", + "chai": "^4.1.2", "classlist.js": "^1.1.20150312", "core-js": "^2.4.1", "jasmine": "^2.6.0", diff --git a/aio/yarn.lock b/aio/yarn.lock index 32589bffcb..79ce7ab267 100644 --- a/aio/yarn.lock +++ b/aio/yarn.lock @@ -807,6 +807,10 @@ assert@^1.1.1: dependencies: util "0.10.3" +assertion-error@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -1984,6 +1988,17 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" +chai@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + chalk@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" @@ -2087,6 +2102,10 @@ chardet@^0.4.0: version "0.0.2" resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" +check-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + chokidar@^1.4.1, chokidar@^1.4.2, chokidar@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -2953,6 +2972,12 @@ decompress-response@^3.2.0, decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" +deep-eql@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + dependencies: + type-detect "^4.0.0" + deep-equal@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -4333,6 +4358,10 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" @@ -7812,6 +7841,10 @@ path-type@^3.0.0: dependencies: pify "^3.0.0" +pathval@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + pbkdf2@^3.0.3: version "3.0.14" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade" @@ -10252,6 +10285,10 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +type-detect@^4.0.0: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + type-is@~1.6.15: version "1.6.15" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410" diff --git a/packages/common/http/src/client.ts b/packages/common/http/src/client.ts index 5b604d5433..177b0a61d6 100644 --- a/packages/common/http/src/client.ts +++ b/packages/common/http/src/client.ts @@ -46,11 +46,14 @@ export type HttpObserve = 'body' | 'events' | 'response'; /** * Perform HTTP requests. + *

执行 HTTP 请求。

* * `HttpClient` is available as an injectable class, with methods to perform HTTP requests. * Each request method has multiple signatures, and the return type varies according to which * signature is called (mainly the values of `observe` and `responseType`). * + * `HttpClient` 是一个可供注入的类,具有一些用来执行 HTTP 请求的方法。 + * 每个请求方法都有多重签名,并根据签名返回不同的数据类型(主要取决于 `observe` 和 `responseType` 的值)。 * */ @Injectable() @@ -59,13 +62,16 @@ export class HttpClient { /** * Send the given `HttpRequest` and return a stream of `HttpEvents`. + *

发送指定的 `HttpRequest` 并返回一个由 `HTTPEvents` 组成的流。

*/ request(req: HttpRequest): Observable>; /** * Construct a request which interprets the body as an `ArrayBuffer` and returns it. + *

构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

* * @return an `Observable` of the body as an `ArrayBuffer`. + *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

*/ request(method: string, url: string, options: { body?: any, @@ -78,8 +84,10 @@ export class HttpClient { /** * Construct a request which interprets the body as a `Blob` and returns it. + *

构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回它。

* * @return an `Observable` of the body as a `Blob`. + *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

*/ request(method: string, url: string, options: { body?: any, @@ -92,8 +100,10 @@ export class HttpClient { /** * Construct a request which interprets the body as text and returns it. + *

构造一个请求,这个请求会把 body 解释为文本,并返回它。

* * @return an `Observable` of the body as a `string`. + *

一个由 `string` 型的 body 组成的 `Observable` 对象。

*/ request(method: string, url: string, options: { body?: any, @@ -106,8 +116,10 @@ export class HttpClient { /** * Construct a request which interprets the body as an `ArrayBuffer` and returns the full event stream. + *

构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -119,8 +131,10 @@ export class HttpClient { /** * Construct a request which interprets the body as an `Blob` and returns the full event stream. + *

构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -133,8 +147,10 @@ export class HttpClient { /** * Construct a request which interprets the body as text and returns the full event stream. + *

构造一个请求,这个请求会把 body 解释为文本,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -147,8 +163,10 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns the full event stream. + *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -162,8 +180,10 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns the full event stream. + *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `R`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `R` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -177,8 +197,10 @@ export class HttpClient { /** * Construct a request which interprets the body as an `ArrayBuffer` and returns the full response. + *

构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -191,8 +213,10 @@ export class HttpClient { /** * Construct a request which interprets the body as a `Blob` and returns the full response. + *

构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -205,8 +229,10 @@ export class HttpClient { /** * Construct a request which interprets the body as text and returns the full response. + *

构造一个请求,这个请求会把 body 解释为文本,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -219,8 +245,10 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns the full response. + *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -234,8 +262,10 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns the full response. + *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `R`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `R` 型的。

*/ request(method: string, url: string, options: { body?: any, @@ -249,8 +279,10 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns it. + *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ request(method: string, url: string, options?: { body?: any, @@ -264,8 +296,10 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns it. + *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `R`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `R` 型的。

*/ request(method: string, url: string, options?: { body?: any, @@ -280,8 +314,10 @@ export class HttpClient { /** * Construct a request in a manner where response type and requested `Observable` are not known * statically. + *

以某种方式构造请求,其响应类型和所请求的 `Observable` 都是无法静态获知的。

* * @return an `Observable` of whatever was requested, typed to `any`. + *

所请求的任意 `Observable`,其类型是 `any`。

*/ request(method: string, url: string, options?: { body?: any, @@ -297,25 +333,35 @@ export class HttpClient { * Constructs an `Observable` for a particular HTTP request that, when subscribed, * fires the request through the chain of registered interceptors and on to the * server. + *

为一个特定的 HTTP 请求构造一个 `Observable`,当它被订阅时,就触发该请求,经过一系列已注册的拦截器的处理之后,最终发给服务器。

* * This method can be called in one of two ways. Either an `HttpRequest` * instance can be passed directly as the only parameter, or a method can be * passed as the first parameter, a string URL as the second, and an * options hash as the third. * + * 该方法有两种调用方式。或者直接把一个 `HttpRequest` 实例作为唯一的参数传进去,或者第一个参数传入 method,第二个参数传入 URL,第三个参数传入表示配置项的哈希对象。 + * * If a `HttpRequest` object is passed directly, an `Observable` of the * raw `HttpEvent` stream will be returned. * + * 如果直接传入 `HttpRequest` 对象,它就会返回一个原始 `HttpEvent` 组成的 `Observable` 流。 + * * If a request is instead built by providing a URL, the options object * determines the return type of `request()`. In addition to configuring * request parameters such as the outgoing headers and/or the body, the options * hash specifies two key pieces of information about the request: the * `responseType` and what to `observe`. * + * 如果是通过提供 URL 的方式构建的,配置项将决定 `request()` 的返回值类型。 + * 除了配置请求头或 body 等请求参数之外,该配置项的哈希对象中还可以指定两个和请求本身有关的键:`responseType` 以及想要 `observe` 什么。 + * * The `responseType` value determines how a successful response body will be * parsed. If `responseType` is the default `json`, a type interface for the * resulting object may be passed as a type parameter to `request()`. * + * `responseType` 的值决定要如何解析响应体。如果 `responseType` 是 `json`(默认值),则还可以为 `request` 传入一个用来表示结果类型的类型接口。 + * * The `observe` value determines the return type of `request()`, based on what * the consumer is interested in observing. A value of `events` will return an * `Observable` representing the raw `HttpEvent` stream, @@ -323,6 +369,12 @@ export class HttpClient { * `Observable>` where the `T` parameter of `HttpResponse` * depends on the `responseType` and any optionally provided type parameter. * A value of `body` will return an `Observable` with the same `T` body type. + * + * `observe` 的值决定 `request()` 的返回值类型,这取决于消费方在订阅时对哪些东西感兴趣。 + * 当它的值是 `events` 时,它将返回一个 `Observable`,以表示原始的 `HTTPEvent` 流,默认还包括网络通讯进度事件。 + * 当它的值是 `response` 时,它将返回一个 `Observable>`,`HttpResponse` 的 `T` 参数 取决于 `responseType` 以及可选提供的类型参数。 + * 当它的值是 `body` 时,它将返回一个 body 类型为 `T` 的 `Observable` 对象。 + * */ request(first: string|HttpRequest, url?: string, options: { body?: any, @@ -442,8 +494,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as an `ArrayBuffer` and returns it. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

* * @return an `Observable` of the body as an `ArrayBuffer`. + *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -456,8 +510,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as a `Blob` and returns it. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

* * @return an `Observable` of the body as a `Blob`. + *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -469,8 +525,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as text and returns it. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回它。

* * @return an `Observable` of the body as a `string`. + *

一个由 `string` 型的 body 组成的 `Observable` 对象。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -482,8 +540,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as an `ArrayBuffer` and returns the full event stream. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -495,8 +555,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as a `Blob` and returns the full event stream. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -508,8 +570,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as text and returns the full event stream. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -521,8 +585,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns the full event stream. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -535,8 +601,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns the full event stream. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

*/ delete(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -549,8 +617,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as an `ArrayBuffer` and returns the full response. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -562,8 +632,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as a `Blob` and returns the full response. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -575,8 +647,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as text and returns the full response. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -588,8 +662,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns the full response. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -602,8 +678,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns the full response. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

*/ delete(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -616,8 +694,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns it. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as an `Object`. + *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

*/ delete (url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -630,8 +710,10 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns it. + *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as type `T`. + *

一个由 `T` 型的 body 组成的 `Observable` 对象。

*/ delete(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -646,6 +728,8 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * DELETE request to be executed on the server. See the individual overloads for * details of `delete()`'s return type based on the provided options. + *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `DELETE` 请求。 + * 关于 `delete()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

*/ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -661,8 +745,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as an `ArrayBuffer` and returns it. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

* * @return an `Observable` of the body as an `ArrayBuffer`. + *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -674,8 +760,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as a `Blob` and returns it. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

* * @return an `Observable` of the body as a `Blob`. + *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -687,8 +775,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as text and returns it. + *

构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回它。

* * @return an `Observable` of the body as a `string`. + *

一个由 `string` 型的 body 组成的 `Observable` 对象。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -700,8 +790,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as an `ArrayBuffer` and returns the full event stream. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -713,8 +805,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as a `Blob` and returns the full event stream. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -726,8 +820,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as text and returns the full event stream. + *

构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -739,8 +835,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns the full event stream. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -753,8 +851,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns the full event stream. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -767,8 +867,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as an `ArrayBuffer` and returns the full response. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -780,8 +882,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as a `Blob` and returns the full response. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -793,8 +897,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as text and returns the full response. + *

构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -806,8 +912,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns the full response. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -820,8 +928,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns the full response. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -834,8 +944,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns it. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as an `Object`. + *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

*/ get(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -848,8 +960,10 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns it. + *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as type `T`. + *

一个由 `T` 型的 body 组成的 `Observable` 对象。

*/ get(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -864,6 +978,8 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * GET request to be executed on the server. See the individual overloads for * details of `get()`'s return type based on the provided options. + *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `GET` 请求。 + * 关于 `get()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

*/ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -879,8 +995,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as an `ArrayBuffer` and returns it. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

* * @return an `Observable` of the body as an `ArrayBuffer`. + *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -891,8 +1009,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as a `Blob` and returns it. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

* * @return an `Observable` of the body as a `Blob`. + *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

*/ }): Observable; head(url: string, options: { @@ -905,8 +1025,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as text and returns it. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回它。

* * @return an `Observable` of the body as a `string`. + *

一个由 `string` 型的 body 组成的 `Observable` 对象。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -918,8 +1040,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as an `ArrayBuffer` and returns the full event stream. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -931,8 +1055,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as a `Blob` and returns the full event stream. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -944,8 +1070,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as text and returns the full event stream. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -957,8 +1085,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns the full event stream. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -971,8 +1101,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns the full event stream. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -985,8 +1117,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as an `ArrayBuffer` and returns the full response. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -998,8 +1132,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as a `Blob` and returns the full response. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1011,8 +1147,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as text and returns the full response. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1024,8 +1162,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns the full response. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1038,8 +1178,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns the full response. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1052,8 +1194,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns it. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as an `Object`. + *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

*/ head(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1066,8 +1210,10 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns it. + *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as type `T`. + *

一个由 `T` 型的 body 组成的 `Observable` 对象。

*/ head(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1082,6 +1228,8 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * HEAD request to be executed on the server. See the individual overloads for * details of `head()`'s return type based on the provided options. + *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `HEAD` 请求。 + * 关于 `head()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

*/ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1096,25 +1244,33 @@ export class HttpClient { /** * Construct a JSONP request for the given URL and name of the callback parameter. + *

使用指定的 URL 和回调函数名构造一个 JSONP 请求。

* * @return an `Observable` of the response object as an `Object` + *

一个 `Object` 型响应对象组成的 `Observable` 对象

*/ jsonp(url: string, callbackParam: string): Observable; /** * Construct a JSONP request for the given URL and name of the callback parameter. + *

使用指定的 URL 和回调函数名构造一个 JSONP 请求。

* * @return an `Observable` of the response object as type `T`. + *

一个 `T` 型响应对象组成的 `Observable` 对象

*/ jsonp(url: string, callbackParam: string): Observable; /** * Constructs an `Observable` which, when subscribed, will cause a request * with the special method `JSONP` to be dispatched via the interceptor pipeline. + *

构造一个 `Observable`,订阅它将经过拦截器管道处理之后发送一个特殊的 `JSONP` 请求。

* * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`). * If no such interceptor is reached, then the `JSONP` request will likely be * rejected by the configured backend. + * + * 必须安装一个合适的拦截器(比如借助 `HttpClientJsonpModule`)。 + * 如果没有这个拦截器,`JSONP` 请求就可能被后端拒绝。 */ jsonp(url: string, callbackParam: string): Observable { return this.request('JSONP', url, { @@ -1126,8 +1282,10 @@ export class HttpClient { /** * Make an OPTIONS request which interprets the body as an `ArrayBuffer` and returns it. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

* * @return an `Observable` of the body as an `ArrayBuffer`. + *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1139,8 +1297,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as a `Blob` and returns it. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

* * @return an `Observable` of the body as a `Blob`. + *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1152,8 +1312,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as text and returns it. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回它。

* * @return an `Observable` of the body as a `string`. + *

一个由 `string` 型的 body 组成的 `Observable` 对象。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1165,8 +1327,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as an `ArrayBuffer` and returns the full event stream. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1178,8 +1342,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as a `Blob` and returns the full event stream. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1191,8 +1357,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as text and returns the full event stream. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1204,8 +1372,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns the full event stream. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1218,8 +1388,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns the full event stream. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1232,8 +1404,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as an `ArrayBuffer` and returns the full response. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1245,8 +1419,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as a `Blob` and returns the full response. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1258,8 +1434,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as text and returns the full response. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1271,8 +1449,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns the full response. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1285,8 +1465,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns the full response. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1299,8 +1481,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns it. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as an `Object`. + *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

*/ options(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1313,8 +1497,10 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns it. + *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as type `T`. + *

一个由 `T` 型的 body 组成的 `Observable` 对象。

*/ options(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1329,6 +1515,8 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * OPTIONS request to be executed on the server. See the individual overloads for * details of `options()`'s return type based on the provided options. + *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `OPTIONS` 请求。 + * 关于 `options()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

*/ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1343,8 +1531,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as an `ArrayBuffer` and returns it. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

* * @return an `Observable` of the body as an `ArrayBuffer`. + *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1356,8 +1546,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as a `Blob` and returns it. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

* * @return an `Observable` of the body as a `Blob`. + *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1369,8 +1561,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as text and returns it. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回它。

* * @return an `Observable` of the body as a `string`. + *

一个由 `string` 型的 body 组成的 `Observable` 对象。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1382,8 +1576,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as an `ArrayBuffer` and returns the full event stream. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1395,8 +1591,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as a `Blob` and returns the full event stream. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1408,8 +1606,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as text and returns the full event stream. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1421,8 +1621,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns the full event stream. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1435,8 +1637,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns the full event stream. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1449,8 +1653,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as an `ArrayBuffer` and returns the full response. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1462,8 +1668,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as a `Blob` and returns the full response. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1475,8 +1683,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as text and returns the full response. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1488,8 +1698,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns the full response. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1502,8 +1714,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns the full response. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1516,8 +1730,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns it. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as an `Object`. + *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

*/ patch(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1530,8 +1746,10 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns it. + *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as type `T`. + *

一个由 `T` 型的 body 组成的 `Observable` 对象。

*/ patch(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1546,6 +1764,8 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * PATCH request to be executed on the server. See the individual overloads for * details of `patch()`'s return type based on the provided options. + *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `PATCH` 请求。 + * 关于 `patch()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

*/ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1560,8 +1780,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as an `ArrayBuffer` and returns it. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

* * @return an `Observable` of the body as an `ArrayBuffer`. + *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1573,8 +1795,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as a `Blob` and returns it. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

* * @return an `Observable` of the body as a `Blob`. + *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1586,8 +1810,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as text and returns it. + *

构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回它。

* * @return an `Observable` of the body as a `string`. + *

一个由 `string` 型的 body 组成的 `Observable` 对象。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1599,8 +1825,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as an `ArrayBuffer` and returns the full event stream. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1612,8 +1840,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as a `Blob` and returns the full event stream. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1625,8 +1855,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as text and returns the full event stream. + *

构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1638,8 +1870,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns the full event stream. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1652,8 +1886,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns the full event stream. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1666,8 +1902,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as an `ArrayBuffer` and returns the full response. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1679,8 +1917,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as a `Blob` and returns the full response. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1692,8 +1932,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as text and returns the full response. + *

构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1705,8 +1947,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns the full response. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1719,8 +1963,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns the full response. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1733,8 +1979,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns it. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as an `Object`. + *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

*/ post(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1747,8 +1995,10 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns it. + *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as type `T`. + *

一个由 `T` 型的 body 组成的 `Observable` 对象。

*/ post(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1763,6 +2013,8 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * POST request to be executed on the server. See the individual overloads for * details of `post()`'s return type based on the provided options. + *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `POST` 请求。 + * 关于 `post()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

*/ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1777,8 +2029,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as an `ArrayBuffer` and returns it. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

* * @return an `Observable` of the body as an `ArrayBuffer`. + *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1790,8 +2044,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as a `Blob` and returns it. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

* * @return an `Observable` of the body as a `Blob`. + *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1803,8 +2059,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as text and returns it. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回它。

* * @return an `Observable` of the body as a `string`. + *

一个由 `string` 型的 body 组成的 `Observable` 对象。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1816,8 +2074,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as an `ArrayBuffer` and returns the full event stream. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1829,8 +2089,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as a `Blob` and returns the full event stream. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1842,8 +2104,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as text and returns the full event stream. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1855,8 +2119,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns the full event stream. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1869,8 +2135,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns the full event stream. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

* * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. + *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1879,8 +2147,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as an `ArrayBuffer` and returns the full response. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1892,8 +2162,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as a `Blob` and returns the full response. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1905,8 +2177,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as text and returns the full response. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1918,8 +2192,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns the full response. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1932,8 +2208,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns the full response. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

* * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. + *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1946,8 +2224,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns it. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as an `Object`. + *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

*/ put(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1960,8 +2240,10 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns it. + *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回它。

* * @return an `Observable` of the body as type `T`. + *

一个由 `T` 型的 body 组成的 `Observable` 对象。

*/ put(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1976,6 +2258,8 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * PUT request to be executed on the server. See the individual overloads for * details of `put()`'s return type based on the provided options. + *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `PUT` 请求。 + * 关于 `put()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

*/ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]},