Http module

text

procedureextensionexperimentalSource

Plain text with Content-Type: text/plain; charset=utf-8.

Example
response := text("not here", 404);
assert(response.status == 404);
assert(string.{ response.body.count, response.body.data } == "not here");

Doesn't run in the browser (skipped on wasm).

text :: (body: string, status := 200) -> Response

Plain text with Content-Type: text/plain; charset=utf-8.

Parameters

body: string
sent as it is.
status := 200
the HTTP status code.

Returns

Example
response := text("not here", 404);
assert(response.status == 404);
assert(string.{ response.body.count, response.body.data } == "not here");

Doesn't run in the browser (skipped on wasm).

See also