post

Function post 

Source
pub fn post<HandlerParams, H>(handler: H) -> MethodRouter
where HandlerParams: 'static, H: RequestHandler<HandlerParams> + Send + Sync + 'static,
Expand 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);