Fake Mirrors
    Preparing search index...

    Class HttpHeadersWrap

    Wrapper class for HTTP message headers.

    • get isFrozen(): boolean

      Checks if the wrapper is frozen (read-only).

      Returns boolean

      true if the wrapper is frozen, false otherwise.

    • get length(): number

      Gets the number of headers.

      Returns number

      The number of headers in the object.

    • Appends a value to an existing header or creates a new one.

      Parameters

      • name: string

        The header name (case-insensitive).

      • value: string

        The value to append.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Deletes one or more headers.

      Parameters

      • arg: string | string[]

        The single header name or the array of names to delete.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Gets the headers as an array of entries.

      Returns [string, HttpHeader][]

      The array of [name, value] pairs.

    • Iterates over all headers.

      Parameters

      • cb: (name: string, value: HttpHeader) => void

        The callback function to call for each header.

      Returns this

      This wrapper for method chaining.

    • Freezes the wrapper to prevent modifications.

      Returns this

      This wrapper for method chaining.

    • Gets a header value as a string or array of strings.

      Parameters

      • name: string

        The header name (case-insensitive).

      Returns HttpHeader | undefined

      The header value, or undefined if the header does not exist.

    • Gets a header value as an array of strings.

      Parameters

      • name: string

        The header name (case-insensitive).

      Returns string[] | undefined

      The header values as an array, or undefined if the header does not exist.

    • Gets the Content-Type header as a parsed object (cached).

      Returns HttpContentType | null

      The parsed Content-Type object, or null if the header is not present.

      Error If Content-Type parsing fails.

    • Gets the Cookie header as a parsed object (cached).

      Returns HttpCookies | null

      The parsed cookies object, or null if the header is not present.

    • Gets the Set-Cookie header as a parsed object (cached).

      Returns HttpSetCookies | null

      The parsed Set-Cookie object, or null if the header is not present.

    • Gets a header value as a single string.

      Parameters

      • name: string

        The header name (case-insensitive).

      Returns string | undefined

      The first header value, or undefined if the header does not exist.

    • Checks if a header exists.

      Parameters

      • name: string

        The header name (case-insensitive).

      Returns boolean

      true if the header exists, false otherwise.

    • Merges headers from another object.

      Parameters

      • headers: HttpHeaders

        The headers object to merge from.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Clears all headers and resets to an empty state.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Sets a header value.

      Parameters

      • name: string

        The header name (case-insensitive).

      • value: HttpHeader

        The new header value.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Sets the Content-Type header from an object.

      Parameters

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

      Error If Content-Type formatting fails.

    • Sets the Cookie header from an object.

      Parameters

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Sets the Set-Cookie header from an object.

      Parameters

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.