Safe Haskell | None |
---|---|
Language | Haskell2010 |
Traits and middlewares to handle HTTP methods.
Synopsis
- newtype Method = Method StdMethod
- data MethodMismatch = MethodMismatch {}
- method :: (Get h Method Request, ArrowChoice h, ArrowError RouteMismatch h) => StdMethod -> Middleware h req (Method ': req)
Documentation
A Trait
for capturing the HTTP method of a request
data MethodMismatch Source #
Failure to match method against an expected value
method :: (Get h Method Request, ArrowChoice h, ArrowError RouteMismatch h) => StdMethod -> Middleware h req (Method ': req) Source #
Check whether the request has a specified HTTP method.
Example usage:
method @GET handler
If the request does not have the specified method, another handler will be tried.
It is also idiomatic to use the template haskell quasiquoter
match
or route
in
cases where both an HTTP method and a path need to be matched.