Http module

html

procedureextensionexperimentalSource

HTML with Content-Type: text/html; charset=utf-8.

Example
response := html("<h1>Hello</h1>");
type, _ := find_header(response.headers, "Content-Type");
assert(type == "text/html; charset=utf-8");

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

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

HTML with Content-Type: text/html; charset=utf-8.

Parameters

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

Returns

Example
response := html("<h1>Hello</h1>");
type, _ := find_header(response.headers, "Content-Type");
assert(type == "text/html; charset=utf-8");

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

See also