Function actix_web::guard::Get

source ·
pub fn Get() -> impl Guard
Expand description

Creates a guard that matches the GET request method.

§Examples

The route in this example will only respond to GET requests.

use actix_web::{guard, web, HttpResponse};

web::route()
    .guard(guard::Get())
    .to(|| HttpResponse::Ok());