Data holder for lambda request.

Useful for cases when request needs to be created for:

  • lambda invocation / reqResMapper
  • findMatchingRules invocation
  • fiddle RequestContext invocation
  • tests (mainly ones invoking RequestContext directly)

Hierarchy

  • LambdaRequest

Implements

Constructors

Properties

_rawBody: Buffer
connection: {
    encrypted: boolean;
} = ...

Type declaration

  • encrypted: boolean

The request headers. Keys are header names, values are either a string, or when multiple values for the same header name are present, an array of strings.

httpVersion: string = '1.1'

The http version (e.g. )

invokeAction?: InvokeAction
invokeSource?: InvokeSource
method: string = 'GET'

The HTTP method

params?: {
    [key: string]: string | string[];
}

The path params returned by the matching route.

Type declaration

  • [key: string]: string | string[]
path: string = '/'

Just the path part of the URL

port: string = '443'

Port on which request came.

protocol: string = 'http'

The protocol (e.g. http or hhtps)

query: {
    [key: string]: string | string[] | undefined;
} = {}

The params extracted from the request URL's query string

Type declaration

  • [key: string]: string | string[] | undefined
rawHeaders: string[] = []

Raw headers, supported by both converting from lambda request and express request

rawUrl: string
secure: boolean = true

Flag indicating if the connection to Edgio is secure (HTTPS) or not (HTTP).

socket: {
    encrypted: boolean;
    remoteAddress: string;
} = ...

Type declaration

  • encrypted: boolean
  • remoteAddress: string
url: string = '/'

The path and query string

Accessors

  • get body(): string
  • The request body as a string

    Returns string

  • set body(value: string): void
  • The request body as a string

    Parameters

    • value: string

    Returns void

  • get rawBody(): Buffer
  • The raw request body as a buffer

    Returns Buffer

  • set rawBody(value: Buffer): void
  • The raw request body as a buffer

    Parameters

    • value: Buffer

    Returns void

Methods

  • Returns a clone of the original request, before any properties were altered.

    Returns LambdaRequest

  • Gets the value of a header

    Returns

    The value of the header

    Parameters

    • name: string

      The name of the header to return - case insensitive

    Returns unknown

  • Removes a header

    Parameters

    • name: string

      The header to remove

    Returns void

  • Sets a header

    Parameters

    • name: string

      The name of the header to set

    • value: unknown

      The value to set

    Returns void

  • Parameters

    • request: IncomingMessage

    Returns Promise<LambdaRequest>

Generated using TypeDoc