Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface HttpRequest

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

Hierarchy

  • HttpRequest

Index

Methods

forEach

  • forEach(cb: (key: string, value: string) => void): void
  • Loops over all headers.

    Parameters

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

          • key: string
          • value: string

          Returns void

    Returns void

getHeader

getMethod

  • getMethod(): string
  • Returns the HTTP method, useful for "any" routes.

    Returns string

getParameter

  • getParameter(index: number): string
  • Returns the parsed parameter at index. Corresponds to route.

    Parameters

    • index: number

    Returns string

getQuery

  • getQuery(): string
  • Returns the part of URL after ? sign or empty string.

    Returns string

getUrl

  • getUrl(): string
  • Returns the URL including initial /slash

    Returns string

setYield

  • 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

Generated using TypeDoc