Fake Mirrors
    Preparing search index...

    Class HttpMethodWrap

    Wrapper class for HTTP message methods.

    • Creates a new wrapper instance.

      Parameters

      • method: "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS"

        The HTTP method to wrap.

      Returns HttpMethodWrap

    • get isFrozen(): boolean

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

      Returns boolean

      true if the wrapper is frozen, false otherwise.

    • Gets the method value.

      Returns "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS"

      The HTTP method string.

    • Checks if the current method matches the specified value(s).

      Parameters

      • arg:
            | "HEAD"
            | "GET"
            | "POST"
            | "PUT"
            | "PATCH"
            | "DELETE"
            | "OPTIONS"
            | ("HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS")[]

        The single method string or an array of methods to check.

      Returns boolean

      true if the method matches any of the specified values, false otherwise.

    • Sets the method value.

      Parameters

      • method: "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS"

        The HTTP method to set.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Factory method to create a wrapper from a request-like object.

      Parameters

      • req: { method?: string }

        The object with an optional method property.

      Returns HttpMethodWrap

      A new wrapper instance.

      Error If req.method is not defined or not supported.