method Reply.text
A text/plain; charset=utf-8 reply.
Example:
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) -> ReplySince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
body | str |
status | i64 = 200 |
Returns
Effects
none declared (pure unless the body says otherwise)
Defined in: std/http/http.oxl:2678