Class HttpHeaders

Common interface for a set of HTTP headers.

Hierarchy

  • HttpHeaders

Implements

Constructors

Properties

length: number

Methods

  • Gets the first value for the given name, ignoring any additional values

    Parameters

    • key: string

      The header name to look for

    Returns string

    The first header value, or default if no values exist

  • Get the list of values for the given name

    Parameters

    • key: string

      The header name to look for

    Returns string[]

    List of values, or empty list if none exist

  • Add a name/value pair

    Parameters

    • key: string

      The header name

    • value: string

      The header value

    Returns void

  • Set a name/value pair, replacing any existing values for the name

    Parameters

    • key: string

      The header name

    • value: string

      The header value

    Returns void

  • Removes all values for the given name

    Parameters

    • key: string

      The header to remove all values for

    Returns void

  • Removes a specific name/value pair

    Parameters

    • key: string

      The header name to remove

    • value: string

      The header value to remove

    Returns void

  • Clears the entire header set

    Returns void

  • Iterator. Allows for: let headers = new HttpHeaders(); ... for (const header of headers) { }

    Returns Iterator<HttpHeader, any, undefined>

Generated using TypeDoc