[][src]Function gotham::helpers::http::response::create_temporary_redirect

pub fn create_temporary_redirect<L: Into<Cow<'static, str>>>(
    state: &State,
    location: L
) -> Response<Body>

Produces a simple empty Response with a Location header and a 302 status.

Examples

fn handler(state: State) -> (State, Response<Body>) {
    let resp = create_temporary_redirect(&state, "/quick-detour");

    (state, resp)
}