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

Safe HaskellSafe-Inferred
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 k sub => HasLink * ((:>) * k (ReqBody k ct a) sub) 
Typeable ([*] -> k -> *) (ReqBody k) 
type MkLink * ((:>) * k (ReqBody k1 ct a) sub) = MkLink k sub 
>>> import Servant.API
>>> import Servant.Common.Text
>>> import Data.Aeson
>>> import Data.Text
>>> data Book
>>> instance ToJSON Book where { toJSON = undefined }