[][src]Function ntex::web::head

pub fn head<Err: ErrorRenderer>() -> Route<Err>

Create route with HEAD method guard.

use ntex::web;

let app = web::App::new().service(
    web::resource("/{project_id}")
        .route(web::head().to(|| async { web::HttpResponse::Ok() }))
);

In the above example, one HEAD route gets added:

  • /{project_id}