6

What Are Angular HttpHeaders?

What Are HttpHeaders?
The Http Headers is immutable Map and each and every set() returns a new instance and applies the changes with lazy parsing.

An immutable set of Http headers, with lazy parsing.

HttpHeaders Constructor -
constructor(headers?: string | { [name: string]: string | string[];});


Imports HttpHeaders from -
import {HttpHeaders } from '@angular/common/http';


HttpHeaders class contains the list of methods -
1.      has() - Checks for existence of header by given name.
2.      get() - Returns the first header that matches given name.
3.      keys() - Returns the names of the headers
4.      getAll() - Returns list of header values for a given name.
5.      append() - Append headers by chaining.
6.      set() -  To set a custom header on the request for a given name
7.      delete() - To delete the header on the request for a given name

For more detail kindly 
refer the link.... 
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.
^