docs: clarify http response type (#32817)

PR Close #32817
This commit is contained in:
Judy Bogart 2019-09-23 09:02:12 -07:00 committed by atscott
parent ffc34b3676
commit 9e7aa60ae7
1 changed files with 12 additions and 1 deletions

View File

@ -20,6 +20,12 @@ import {HttpEvent, HttpResponse} from './response';
/** /**
* Constructs an instance of `HttpRequestOptions<T>` from a source `HttpMethodOptions` and * Constructs an instance of `HttpRequestOptions<T>` from a source `HttpMethodOptions` and
* the given `body`. This function clones the object and adds the body. * 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<T>( function addBody<T>(
options: { options: {
@ -46,10 +52,15 @@ export type HttpObserve = 'body' | 'events' | 'response';
/** /**
* Performs HTTP requests. * Performs HTTP requests.
*
* This service is available as an injectable class, with methods to perform 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 * 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`). * 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 * @usageNotes
* Sample HTTP requests for the [Tour of Heroes](/tutorial/toh-pt0) application. * Sample HTTP requests for the [Tour of Heroes](/tutorial/toh-pt0) application.