Skip to content

API reference / @backpack/aws-lambda / rest / Request

Interface: Request

Various utilities relating to a HTTP Request

Methods

getBody()

ts
getBody(): Body;

Retrieves the body of the HTTP request.

Returns

Body


getHeader()

ts
getHeader<TOptions>(name, options?): InferResult<string, TOptions, false>;

Retrieves one or more request headers.

Type Parameters

Type Parameter
TOptions extends MultiOptions

Parameters

ParameterTypeDescription
namestringThe name of the request header.
options?TOptionsAdditional options.

Returns

InferResult<string, TOptions, false>

Throws

RequestValidationError


getPathParameter()

ts
getPathParameter<TOptions>(name, options?): InferResult<string, TOptions, true>;

Retrieves one or more path parameters.

Type Parameters

Type Parameter
TOptions extends Options

Parameters

ParameterTypeDescription
namestringThe name of the path parameter.
options?TOptionsAdditional options.

Returns

InferResult<string, TOptions, true>

Throws

RequestValidationError


getQueryParameter()

ts
getQueryParameter<TOptions>(name, options?): InferResult<string, TOptions, false>;

Retrieves one or more query parameters.

Type Parameters

Type Parameter
TOptions extends MultiOptions

Parameters

ParameterTypeDescription
namestringThe name of the query parameter.
options?TOptionsAdditional options.

Returns

InferResult<string, TOptions, false>

Throws

RequestValidationError