HttpHeaders

class

npm Package @angular/common
Module import { HttpHeaders } from '@angular/common/http';
Source common/http/src/headers.ts

Overview

class HttpHeaders {
  constructor(headers?: string | {...})
  has(name: string): boolean
  get(name: string): string | null
  keys(): string[]
  getAll(name: string): string[] | null
  append(name: string, value: string | string[]): HttpHeaders
  set(name: string, value: string | string[]): HttpHeaders
  delete(name: string, value?: string | string[]): HttpHeaders
}

Description

Immutable set of Http headers, with lazy parsing.

Constructor

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

Members

has(name: string): boolean

Checks for existence of header by given name.

get(name: string): string | null

Returns first header that matches given name.

keys(): string[]

Returns the names of the headers

getAll(name: string): string[] | null

Returns list of header values for a given name.

append(name: string, value: string | string[]): HttpHeaders

set(name: string, value: string | string[]): HttpHeaders

delete(name: string, value?: string | string[]): HttpHeaders

© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/common/http/HttpHeaders