method Reply.withStatus
A copy of the reply with another status code.
Example:
use std.http { Reply }
fn main() io {
let r = Reply.text("created").withStatus(201)
print("{r.status}")
}Вывод
201
pub(api) fn withStatus(code: i64) -> ReplyС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
code | i64 |
Возвращает
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/http/http.oxl:2926