automatical derivation of querying functions for servant webservices

Version on this page:0.2.2@rev:2
LTS Haskell 22.17:0.20@rev:3
Stackage Nightly 2024-04-18:0.20@rev:3
Latest on Hackage:0.20@rev:3

See all snapshots servant-client appears in

BSD-3-Clause licensed by Alp Mestanogullari, Sönke Hahn, Julian K. Arni
Maintained by [email protected]
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