HttpClient documentation confusing ("response body as a JSON object") about overload #14 / #15 of multiple methods (request, get, post)
See original GitHub issueDescription
As HttpClient’s documentation shows, its methods provide numerous variants, which return various results. The results depend on what the HTTP requests return. When a request returns JSON, the call will provide an object corresponding to the object represented by the returned JSON string.
For example, the specification of “overload #14” of get()
ends with:
Returns Observable<Object>: An Observable of the response body as a JSON object.
To my knowledge, there is no such thing as “a JSON object”. What the Observable may provide is a [JavaScript] object corresponding to the returned JSON string.
This also affects overload #14 of delete()
, head()
overload #14, options()
overload #14, patch()
overload #14, post()
overload #14, put()
overload #14 and request()
overload #15.
What is the affected URL?
https://angular.io/api/common/http/HttpClient
Please provide the steps to reproduce the issue
This does not report a behavioral bug.
Please provide the expected behavior vs the actual behavior you encountered
This does not report a behavioral bug.
Please provide a screenshot if possible
No response
Please provide the exception or error you saw
This does not report a behavioral bug.
Is this a browser-specific issue? If so, please specify the device, browser, and version.
No
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Thank you for the interesting research @ashide2729 While changing to “object” would be exact and better, it would be much better to use a phrasing which at least partly specifies the returned object, like the one I offered.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.