Skip to content

basalt / http/src / RawBodySession

Class: RawBodySession ​

Defined in: http/src/raw-body.ts:275

One request's raw body: reads it once, only when the pipeline asks (after enrichers and guards), and releases whatever is left otherwise. Created by the pipeline; not public API.

Constructors ​

Constructor ​

> new RawBodySession(request, options): RawBodySession

Defined in: http/src/raw-body.ts:278

Parameters ​

request ​

HttpRequest

options ​

ResolvedRawBodyOptions

Returns ​

RawBodySession

Properties ​

options ​

> readonly options: ResolvedRawBodyOptions

Defined in: http/src/raw-body.ts:280

Methods ​

read() ​

> read(): Promise<RawBody>

Defined in: http/src/raw-body.ts:284

The handler's body. Throws 413 over the cap, 500 when no adapter supplied bytes.

Returns ​

Promise<RawBody>


release() ​

> release(reply): void

Defined in: http/src/raw-body.ts:304

Called once the route is done. A body nobody read (a guard rejected first) gets Connection: close and is drained up to the cap — the request can never hang on an unread body.

Parameters ​

reply ​

HttpReply

Returns ​

void

Released under the MIT License.