method Reply.redirect
A redirect to location (default 302 Found; use 301, 303, 307 or 308 as needed).
Example:
use std.http { Reply }
fn main() io {
let r = Reply.redirect("/login", 303)
print("{r.status} {r.headers[0].name}: {r.headers[0].value}")
}Output
303 Location: /login
pub(api) static fn redirect(location: str, status: i64 = 302) -> ReplySince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
location | str |
status | i64 = 302 |
Returns
Effects
none declared (pure unless the body says otherwise)
Defined in: std/http/http.oxl:2756