#[post]Expand description
Defines a handler for HTTP POST requests.
This macro should be used inside an impl block of a struct annotated with the #[controller] macro.
§Parameters
path: The path for the POST request, e.g.,"/api"
§Usage
ⓘ
#[controller("/api")]
struct MyController {}
#[routes]
impl MyController {
#[post("/items")]
async fn create_item(&self, req: Request) -> HttpResult<HttpResponse> {
Ok(HttpResponse::Ok().message("Item created"))
}
}