solarnetwork-api-core
    Preparing search index...

    Class HttpHeaders

    HTTP headers multi-map.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    ACCEPT: "Accept"

    The Accept header.

    AUTHORIZATION: "Authorization"

    The Authorization header.

    CONTENT_MD5: "Content-MD5"

    The Content-MD5 header.

    CONTENT_TYPE: "Content-Type"

    The Content-Type header.

    DATE: "Date"

    The Date header.

    DIGEST: "Digest"

    The Digest header.

    HOST: "Host"

    The Host header.

    X_SN_DATE: "X-SN-Date"

    The X-SN-Date header.

    X_SN_PRE_SIGNED_AUTHORIZATION: "X-SN-PreSignedAuthorization"

    The X-SN-PreSignedAuthorization header.

    Methods

    • Add a value.

      This method will append values to existing keys.

      Parameters

      • key: string

        the key to use

      • value: any

        the value to add; if undefined nothing will be added

      Returns this

    • 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

    • Get the entire mapping as a single-valued Map instance.

      This will return the first avaialble value for every key in the mapping.

      Returns Map<string, any>

      a new Map instance

    • 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 this

      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 this

      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