Copyright | (c) Frederick Pringle 2025 |
---|---|
License | BSD-3-Clause |
Maintainer | freddyjepringle@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Servant.API.Routes.Request
Description
Term-level representation of the request bodies that Servant endpoints expect.
Synopsis
- data Request
- unRequest :: Lens' Request (Some TypeRep)
- noRequest :: Request
- oneRequest :: forall a. Typeable a => Request
- allOfRequests :: forall as. AllTypeable as => Request
- requests :: Traversal' Request TypeRep
Documentation
A representation of the request body(s) that a Servant endpoint expects.
Under the hood, Request
is a
.
This allows for the possibility that an endpoint might expect the request body
to parse as several different types (multiple Some
TypeRep
ReqBody'
s).
Note that this type doesn't include any information about the headers that an endpoint expects, since those are independent of the request body.
oneRequest :: forall a. Typeable a => Request Source #
The request body can only be of one type. Equivalent to a single
.ReqBody
_ a
allOfRequests :: forall as. AllTypeable as => Request Source #
The endpoint expects the request body to be parsed as multiple (>1) types.
Equivalent to multiple ReqBody
s chained with :>
.