X Tutup
uWebSockets.js v20.60.0 documentation
    Preparing search index...

    Interface HttpRequest

    An HttpRequest is stack allocated and only accessible during the callback invocation.

    interface HttpRequest {
        forEach(cb: (key: string, value: string) => void): void;
        getCaseSensitiveMethod(): string;
        getHeader(lowerCaseKey: RecognizedString): string;
        getMethod(): string;
        getParameter(index: number | RecognizedString): string;
        getQuery(): string;
        getQuery(key: string): string;
        getUrl(): string;
        setYield(_yield: boolean): HttpRequest;
    }
    Index

    Methods

    • Loops over all headers.

      Parameters

      • cb: (key: string, value: string) => void

      Returns void

    • Returns the HTTP method as-is.

      Returns string

    • Returns the lowercased HTTP method, useful for "any" routes.

      Returns string

    • Returns the parsed parameter at index. Corresponds to route. Can also take the name of the parameter.

      Parameters

      Returns string

    • Returns the raw querystring (the part of URL after ? sign) or empty string.

      Returns string

    • Returns a decoded query parameter value or undefined.

      Parameters

      • key: string

      Returns string

    • Returns the URL including initial /slash

      Returns string

    • Setting yield to true is to say that this route handler did not handle the route, causing the router to continue looking for a matching route handler, or fail.

      Parameters

      • _yield: boolean

      Returns HttpRequest

    X Tutup