Copyright | (c) Raghu Kaippully 2020 |
---|---|
License | MPL-2.0 |
Maintainer | rkaippully@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Middlewares related to HTTP methods.
Synopsis
- method :: forall t m req res a. (IsStdMethod t, MonadRouter m) => RequestMiddleware m req (Method t ': req) res a
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.