Attribute Macro actix_web::post

source ·
Available on crate feature macros only.
Expand description

Creates route handler with actix_web::guard::Post.


#[post("path"[, attributes])]


  • "path": Raw literal string with path for which to register handler.
  • name = "resource_name": Specifies resource name for the handler. If not set, the function name of handler is used.
  • guard = "function_name": Registers function as guard using actix_web::guard::fn_guard.
  • wrap = "Middleware": Registers a resource middleware.


Function name can be specified as any expression that is going to be accessible to the generate code, e.g my_guard or my_module::my_guard.


async fn example() -> HttpResponse {