mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 00:21:08 +01:00
Create helper function for HTTP Trace Method
Create *route* with `TRACE` method guard.
This commit is contained in:
parent
bdccccd536
commit
8ec8ccf4fb
18
src/web.rs
18
src/web.rs
@ -193,6 +193,24 @@ pub fn head() -> Route {
|
|||||||
method(Method::HEAD)
|
method(Method::HEAD)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create *route* with `TRACE` method guard.
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// use actix_web::{web, App, HttpResponse};
|
||||||
|
///
|
||||||
|
/// let app = App::new().service(
|
||||||
|
/// web::resource("/{project_id}")
|
||||||
|
/// .route(web::trace().to(|| HttpResponse::Ok()))
|
||||||
|
/// );
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
|
/// In the above example, one `HEAD` route gets added:
|
||||||
|
/// * /{project_id}
|
||||||
|
///
|
||||||
|
pub fn trace() -> Route {
|
||||||
|
method(Method::TRACE)
|
||||||
|
}
|
||||||
|
|
||||||
/// Create *route* and add method guard.
|
/// Create *route* and add method guard.
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
|
Loading…
Reference in New Issue
Block a user