servant-client

automatical derivation of querying functions for servant webservices

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

Version on this page:0.2.1@rev:4
LTS Haskell 22.14:0.20@rev:3
Stackage Nightly 2024-03-29: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.1@sha256:a0037c25ba6a332a0dd7d48c0b3470aa30f57831796f1dbc53599d308e9cb377,2268

Module documentation for 0.2.1

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