servant-client

automatical derivation of querying functions for servant webservices

http://haskell-servant.github.io/

Version on this page:0.2.2@rev:2
LTS Haskell 17.11:0.18.2
Stackage Nightly 2021-05-10:0.18.2
Latest on Hackage:0.18.2

See all snapshots servant-client appears in

BSD-3-Clause licensed by Alp Mestanogullari, Sönke Hahn, Julian K. Arni
Maintained by alpmestan@gmail.com
This version can be pinned in stack with:servant-client-0.2.2@sha256:cdfdfa765886f1402ae1baec26abccb2c11347bb6fe424768b7edeb359035c0f,2298

Module documentation for 0.2.2

This library lets you derive automatically Haskell functions that let you query each endpoint of a servant webservice.

Example below.

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
(getAllBooks :<|> postNewBook) = client myApi