pub fn post<HandlerParams, H>(handler: H) -> MethodRouterExpand description
Create a new MethodRouter with a POST handler.
This is a shorthand to calling MethodRouter::new and then MethodRouter::post.
ยงExamples
use cot::html::Html;
use cot::router::method::post;
async fn test_handler() -> cot::Result<Html> {
Ok(Html::new("test"))
}
let method_router = post(test_handler);