...

/

The HttpClient Service

The HttpClient Service

Let's explore the HttpClient service, which we will use to make API calls in our Angular applications.

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
...