• Overview
@angular/common/http

HttpHeaders

Class

Represents the header configuration options for an HTTP request. Instances are immutable. Modifying methods return a cloned instance with the change. The original object is never changed.

  
    class HttpHeaders {}
  
  

has

boolean

Checks for existence of a given header.

@paramnamestring

The header name to check for existence.

@returnsboolean

get

string | null

Retrieves the first value of a given header.

@paramnamestring

The header name.

@returnsstring | null

keys

string[]

Retrieves the names of the headers.

@returnsstring[]

getAll

string[] | null

Retrieves a list of values for a given header.

@paramnamestring

The header name from which to retrieve values.

@returnsstring[] | null

Appends a new value to the existing set of values for a header and returns them in a clone of the original instance.

@paramnamestring

The header name for which to append the values.

@paramvaluestring | string[]

The value to append.

@returnsHttpHeaders

Sets or modifies a value for a given header in a clone of the original instance. If the header already exists, its value is replaced with the given value in the returned object.

@paramnamestring

The header name.

@paramvaluestring | string[]

The value or values to set or override for the given header.

@returnsHttpHeaders

Deletes values for a given header in a clone of the original instance.

@paramnamestring

The header name.

@paramvaluestring | string[] | undefined

The value or values to delete for the given header.

@returnsHttpHeaders
Jump to details