OxL Reference

method Reply.withStatus

A copy of the reply with another status code.

Example:

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

fn main() io {
  let r = Reply.text("created").withStatus(201)
  print("{r.status}")
}
Output
201
pub(api) fn withStatus(code: i64) -> Reply

Since. 1.0.0-beta

Parameters

NameType
codei64

Returns

Reply

Effects

none declared (pure unless the body says otherwise)

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

See also