Function actix_web::guard::Options

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

Creates a guard that matches the OPTIONS request method.

§Examples

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

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

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