Interface Request

Request represents an API request.

interface Request {
    baseUrl: string;
    body: Buffer;
    headers: {
        [header: string]: string | string[];
    };
    hostname: string;
    method: string;
    params: {
        [param: string]: string;
    };
    path: string;
    protocol: string;
    query: {
        [query: string]: string | string[];
    };
    rawHeaders: string[];
}

Properties

baseUrl: string

The base url on which this http request was served.

body: Buffer

The body of the HTTP request.

headers: {
    [header: string]: string | string[];
}

The headers of the HTTP request.

Type declaration

  • [header: string]: string | string[]
hostname: string

The hostname of the request.

method: string

The method of the HTTP request.

params: {
    [param: string]: string;
}

The path parameters of the HTTP request. Each {param} in the matched route is available as a property of this oject.

Type declaration

  • [param: string]: string
path: string

The raw path from the HTTP request.

protocol: string

The protocol of the request (e.g. HTTP/HTTPS).

query: {
    [query: string]: string | string[];
}

The query parameters parsed from the query string of the request URL.

Type declaration

  • [query: string]: string | string[]
rawHeaders: string[]

The headers of the HTTP request.

Generated using TypeDoc