Function warp::redirect::see_other

source ·
pub fn see_other(uri: impl AsLocation) -> impl Reply
Expand description

HTTP 303 See Other Description: The response to the request can be found at a different URL, and the client should retrieve it using the GET method. Usage: It is typically used to redirect the client to another URL using a GET request after processing a POST request. It ensures that the client doesn’t repeat the POST request if they refresh the page. Common Use Case: After form submissions or any non-idempotent request.

The HTTP method of the request to the new location will always be GET.

§Example

use warp::{http::Uri, Filter};

let route = warp::path("v1")
    .map(|| {
        warp::redirect::see_other(Uri::from_static("/v2"))
    });