Categories
Angular Answers

How to fix HTTP Angular HttpClient not sending the header?

Spread the love

Sometimes, we want to fix HTTP Angular HttpClient not sending the header.

In this article, we’ll look at how to fix HTTP Angular HttpClient not sending the header.

How to fix HTTP Angular HttpClient not sending the header?

To fix HTTP Angular HttpClient not sending the header, we create a header object.

For instance, we write

http.get(url, {
  headers: { header1: "value1", header2: "value2" },
});

to call http.get with the url we want to make the request to.

And we set the headers property to an object with the request header keys and values.

Conclusion

To fix HTTP Angular HttpClient not sending the header, we create a header object.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *