OxL Reference

method Reply.text

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

Example:

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

fn main() io {
  let r = Reply.text("not found", 404)
  print("{r.status} {r.headers[0].value}")
}
Output
404 text/plain; charset=utf-8
pub(api) static fn text(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:2678

See also