Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HttpHeaders

Package version

A collection of HTTP header key/value pairs.

Hierarchy

  • HttpHeaders

Index

Constructors

constructor

Methods

clone

  • Create a deep clone/copy of this HttpHeaders collection.

    Returns HttpHeaders

contains

  • contains(headerName: string): boolean
  • Get whether or not this header collection contains a header entry for the provided header name.

    Parameters

    • headerName: string

    Returns boolean

get

  • get(headerName: string): string | undefined
  • Get the header value for the provided header name, or undefined if no header exists in this collection with the provided name.

    Parameters

    • headerName: string

      The name of the header.

    Returns string | undefined

headerNames

  • headerNames(): string[]
  • Get the header names that are contained in this collection.

    Returns string[]

headerValues

  • headerValues(): string[]
  • Get the header names that are contained in this collection.

    Returns string[]

headersArray

  • Get the headers that are contained in this collection as an array.

    Returns HttpHeader[]

rawHeaders

  • Get the headers that are contained this collection as an object.

    Returns RawHttpHeaders

remove

  • remove(headerName: string): boolean
  • Remove the header with the provided headerName. Return whether or not the header existed and was removed.

    Parameters

    • headerName: string

      The name of the header to remove.

    Returns boolean

set

  • set(headerName: string, headerValue: string | number): void
  • Set a header in this collection with the provided name and value. The name is case-insensitive.

    Parameters

    • headerName: string

      The name of the header to set. This value is case-insensitive.

    • headerValue: string | number

      The value of the header to set.

    Returns void

toJson

  • Get the JSON object representation of this HTTP header collection.

    Returns RawHttpHeaders

toString

  • toString(): string
  • Get the string representation of this HTTP header collection.

    Returns string

Generated using TypeDoc