question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HttpClient documentation confusing ("response body as a JSON object") about overload #14 / #15 of multiple methods (request, get, post)

See original GitHub issue

Description

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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Chealercommented, Jul 28, 2022

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.

0reactions
angular-automatic-lock-bot[bot]commented, Oct 3, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - POSTing JsonObject With HttpClient From Web API
Using this answer I kept receiving a "400 Bad Request" response from an API I was POSTing my JSON request to (Visual Studio...
Read more >
Introduction to JSON-Java (org.json) - Baeldung
The put() method is an overloaded method that accepts a key of type String and multiple types for the value. For the complete...
Read more >
Node.js v19.3.0 Documentation
Find the function call responsible for the context loss by logging the content of asyncLocalStorage.getStore() after the calls you suspect are responsible for ......
Read more >
Model binding JSON POSTs in ASP.NET Core
In this post, I am going to show what to do if you are converting a project to ASP.NET Core and you discover...
Read more >
Passing multiple POST parameters to Web API Controller ...
Web API allows for RPC style method access, but there are differences from older Microsoft AJAX APIs when it comes to passing multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found