In this tutorial we’ll be seeing a detailed guide with examples using the new HttpClient in Angular 10, available from the @angular/common/http module starting with Angular 4.3+ and which replaces the old HTTP client that was available from the @angular/http package. This upgrade is not just a change in the name and import path of the module but brings a whole new and powerful features for how you make HTTP requests in Angular.

In this tutorial, we are going to learn how to use HttpClient by example in Angular 10. We’ll see how to send HTTP POST, GET, PUT and DELETE requests to a back-end server.

The modern web has dramatically evolved in the last few years. Browsers can now run complex JavaScript web applications and most often than not these apps need to fetch data from remote HTTP servers to display it to the users.

Modern browsers provide two different mechanisms for sending HTTP requests and getting responses from web servers:

The old XMLHttpRequest interface which is wrapped by most existing JS libraries (such as jQuery ) in a simple to use API.
The relatively new fetch() API.

#angular

Angular 10 HttpClient
1.80 GEEK