Skip to content

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

Interface: Body

Methods

json()

ts
json<T, TOptions>(options?): InferResult<T, TOptions, true>;

Deserializes the JSON representation of the body.

Type Parameters

Type ParameterDefault type
T-
TOptions extends OptionsOptions

Parameters

ParameterTypeDescription
options?TOptionsAdditional options.

Returns

InferResult<T, TOptions, true>

Throws

RequestValidationError


text()

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

Retrieves the plain text representation of the body.

Type Parameters

Type Parameter
TOptions extends Options

Parameters

ParameterTypeDescription
options?TOptionsAdditional options.

Returns

InferResult<string, TOptions, true>

Throws

RequestValidationError