From 9e7aa60ae774e8d8e8cde423750ab33df43e8b7c Mon Sep 17 00:00:00 2001 From: Judy Bogart Date: Mon, 23 Sep 2019 09:02:12 -0700 Subject: [PATCH] docs: clarify http response type (#32817) PR Close #32817 --- packages/common/http/src/client.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/common/http/src/client.ts b/packages/common/http/src/client.ts index b374d471a2..945feece0a 100644 --- a/packages/common/http/src/client.ts +++ b/packages/common/http/src/client.ts @@ -20,6 +20,12 @@ import {HttpEvent, HttpResponse} from './response'; /** * Constructs an instance of `HttpRequestOptions` from a source `HttpMethodOptions` and * the given `body`. This function clones the object and adds the body. + * + * Note that the `responseType` *options* value is a String that identifies the + * single data type of the response. + * A single overload version of the method handles each response type. + * The value of `responseType` cannot be a union, as the combined signature could imply. + * */ function addBody( options: { @@ -46,10 +52,15 @@ export type HttpObserve = 'body' | 'events' | 'response'; /** * Performs HTTP requests. - * * This service is available as an injectable class, with methods to perform HTTP requests. * Each request method has multiple signatures, and the return type varies based on * the signature that is called (mainly the values of `observe` and `responseType`). + * + * Note that the `responseType` *options* value is a String that identifies the + * single data type of the response. + * A single overload version of the method handles each response type. + * The value of `responseType` cannot be a union, as the combined signature could imply. + * * @usageNotes * Sample HTTP requests for the [Tour of Heroes](/tutorial/toh-pt0) application.