OxL Reference

method Reply.html

A text/html; charset=utf-8 reply.

Example:

oxl✓ checked in CI
use std.http { Reply }

fn main() io {
  let r = Reply.html("<h1>Hello</h1>")
  print("{r.status} {r.headers[0].value}")
}
Output
200 text/html; charset=utf-8
pub(api) static fn html(body: str, status: i64 = 200) -> Reply

Since. 1.0.0-beta

Parameters

NameType
bodystr
statusi64 = 200

Returns

Reply

Effects

none declared (pure unless the body says otherwise)

Defined in: std/http/http.oxl:2694

See also