No description
aeb1136658
The job of a manager is to synchronize threads, so it is not necessary to block. |
||
---|---|---|
src/Servant | ||
test | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
docs.sh | ||
LICENSE | ||
README.md | ||
servant-client.cabal | ||
Setup.hs |
servant-client
This library lets you automatically derive Haskell functions that let you query each endpoint of a servant webservice.
Example
type MyApi = "books" :> Get [Book] -- GET /books
:<|> "books" :> ReqBody Book :> Post Book -- POST /books
myApi :: Proxy MyApi
myApi = Proxy
getAllBooks :: BaseUrl -> EitherT String IO [Book]
postNewBook :: Book -> BaseUrl -> EitherT String IO Book
-- 'client' allows you to produce operations to query an API from a client.
(getAllBooks :<|> postNewBook) = client myApi