The HttpClient Service
Explore how the Angular HttpClient service simplifies making API calls by using browser-supported XMLHttpRequest and Fetch APIs. Understand the integration process by updating your app module and services to enable seamless HTTP communication.
The HttpClient service
In modern web applications, there are a number of ways to access an external API. As we are using Angular, we have to use what the browser gives us. Thankfully, modern browsers support two ways of reaching an API, which are as follows:
The XMLHttpRequest Interface
The XMLHttpRequest interface is an API that uses an object’s methods to transfer data from a web server.
These methods are known as the Request methods and they consist of the following:
- OPTIONS
- GET
- POST
- PUT
- DELETE