Http module

read

procedure · 1 overloadsince 0.30.0Source

Copies the next bytes of the body, at most buffer.count, into buffer and returns how many. Zero means the body is over (an empty buffer also reads zero). Waits for bytes when none have arrived, within config.body_timeout. A body over the route's limit (max_body, else config.max_body_size) is a 413, and a client that stops sending a 408; the error stays the same on later calls.

read :: (body: *Body, buffer: [] u8) -> (int, Http_Error)

Copies the next bytes of the body, at most buffer.count, into buffer and returns how many. Zero means the body is over (an empty buffer also reads zero). Waits for bytes when none have arrived, within config.body_timeout. A body over the route's limit (max_body, else config.max_body_size) is a 413, and a client that stops sending a 408; the error stays the same on later calls.

Parameters

body: *Body
buffer: [] u8

Returns

int

See also