Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ReqBody a
Documentation
Extract the request body as a value of type a
.
Example:
-- POST /books type MyApi = "books" :> ReqBody Book :> Post Book
(FromJSON a, HasServer sublayout) => HasServer ((:>) * (ReqBody * a) sublayout) | If you use All it asks is for a Example: type MyApi = "books" :> ReqBody Book :> Post Book server :: Server MyApi server = postBook where postBook :: Book -> EitherT (Int, String) IO Book postBook book = ...insert into your db... |
type Server ((:>) * (ReqBody * a) sublayout) = a -> Server sublayout |