servant-0.12.1: A family of combinators for defining webservices APIs

Safe HaskellSafe
LanguageHaskell2010

Servant.API.ReqBody

Synopsis

Documentation

data ReqBody (contentTypes :: [*]) a Source #

Extract the request body as a value of type a.

Example:

>>> -- POST /books
>>> type MyApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book

Instances

HasLink k2 sub => HasLink * ((:>) * k2 (ReqBody k1 ct a) sub) Source # 

Associated Types

type MkLink ((* :> k2) (ReqBody k1 ct a) sub) (endpoint :: (* :> k2) (ReqBody k1 ct a) sub) :: * Source #

Methods

toLink :: Proxy ((* :> k2) (ReqBody k1 ct a) sub) endpoint -> Link -> MkLink ((* :> k2) (ReqBody k1 ct a) sub) endpoint Source #

type MkLink * ((:>) * k1 (ReqBody k2 ct a) sub) Source # 
type MkLink * ((:>) * k1 (ReqBody k2 ct a) sub) = MkLink k1 sub
>>> import Servant.API
>>> import Data.Aeson
>>> import Data.Text
>>> data Book
>>> instance ToJSON Book where { toJSON = undefined }