HttpRequest.readBody

Reads the entirety of the request body, and passes it to the given output stream.

Throws an exception if the connection is closed before the expected data can be read (if a Content-Length header is given).

struct HttpRequest
ulong
readBody
(
S
)
(,
bool allowInfiniteRead = false
)
if (
isByteOutputStream!S
)

Parameters

outputStream S

An output byte stream to write the body to.

allowInfiniteRead bool

Whether to allow the function to read potentially infinitely if no Content-Length header is provided.

Return Value

Type: ulong

The number of bytes that were read.