HTTP headers multi-map.

Hierarchy

Constructors

Properties

#mappingNames: string[]

List of mappings to maintain insertion order.

#mappings: Record<string, MultiMapValue>

Mapping of lower-case header names to {key:X, val:[]} values.

ACCEPT: "Accept" = "Accept"

The Accept header.

AUTHORIZATION: "Authorization" = "Authorization"

The Authorization header.

CONTENT_MD5: "Content-MD5" = "Content-MD5"

The Content-MD5 header.

CONTENT_TYPE: "Content-Type" = "Content-Type"

The Content-Type header.

DATE: "Date" = "Date"

The Date header.

DIGEST: "Digest" = "Digest"

The Digest header.

HOST: "Host" = "Host"

The Host header.

X_SN_DATE: "X-SN-Date" = "X-SN-Date"

The X-SN-Date header.

Methods

  • Add/replace values on a map.

    Parameters

    • key: string

      the key to change

    • value: any

      the value to add; if undefined then nothing will be added

    • Optional replace: boolean

      if true then replace all existing values; if false append to any existing values

    Returns HttpHeaders

    this object

  • Test if there are any values associated with a key.

    Parameters

    • key: string

      the key to test

    Returns boolean

    true if there is at least one value associated with the key

  • Get the first avaialble value assocaited with a key.

    Parameters

    • key: string

      the key of the value to get

    Returns any

    the first available value associated with the key, or undefined if not available

  • Set a value.

    This method will replace any existing values with just value.

    Parameters

    • key: string

      the key to use

    • value: any

      the value to set; if undefined nothing will be added

    Returns HttpHeaders

    this object

  • Set multiple values.

    This method will replace any existing values with those provided on values.

    Parameters

    • values: Record<string, any>

      an object who's enumerable properties will be added to this map

    Returns HttpHeaders

    this object

  • Remove all values associated with a key.

    Parameters

    • key: string

      the key of the values to remove

    Returns undefined | any[]

    the removed values, or undefined if no values were present for the given key

  • Get the values associated with a key.

    Parameters

    • key: string

      the key of the values to get

    Returns undefined | any[]

    the array of values associated with the key, or undefined if not available

Generated using TypeDoc