webgear-server-0.1.0: Composable, type-safe library to build HTTP API servers
Copyright(c) Raghu Kaippully 2020
LicenseMPL-2.0
Maintainerrkaippully@gmail.com
Safe HaskellNone
LanguageHaskell2010

WebGear.Middlewares.Method

Description

Middlewares related to HTTP methods.

Synopsis

Documentation

method :: forall t m req res a. (IsStdMethod t, MonadRouter m) => RequestMiddleware m req (Method t ': req) res a Source #

A middleware to check whether the request has a specified HTTP method.

Typically this would be used with a type application such as:

method @GET handler

It is also idiomatic to use the template haskell quasiquoter match in cases where both HTTP method and path needs to be matched.