You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Julian K. Arni bf47b2d86f Bump to 0.4.4.6. 6 years ago
..
src/Servant added status code 202 to servant-client POST responses 6 years ago
test HasClient instance for Delete cts' () now does not care at all about content types provided 7 years ago
CHANGELOG.md HasClient instance for Delete cts' () now does not care at all about content types provided 7 years ago
LICENSE prepare merge 7 years ago
README.md update examples in servant-client. fixes #75 7 years ago
Setup.hs prepare merge 7 years ago
default.nix Bump everything to 0.4 7 years ago
docs.sh prepare merge 7 years ago
servant-client.cabal Bump to 0.4.4.6. 6 years ago

README.md

servant-client

servant

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

Example

type MyApi = "books" :> Get '[JSON] [Book] -- GET /books
        :<|> "books" :> ReqBody Book :> Post '[JSON] Book -- POST /books

myApi :: Proxy MyApi
myApi = Proxy

getAllBooks :: EitherT String IO [Book]
postNewBook :: Book -> EitherT String IO Book
-- 'client' allows you to produce operations to query an API from a client.
(getAllBooks :<|> postNewBook) = client myApi host
  where host = BaseUrl Http "localhost" 8080