Go to file
2015-01-01 15:14:07 +01:00
src/Servant Declared query string parameters are always sent in requests, even when no value is assigned to them (?name). The server handles a missing query parameter, and a query parameter with no value the same, but to be consistent with the documentation ("If you give Nothing, nothing will be added to the query string.") I made a small change to avoid sending empty query parameters. Also the value and req' parameters were flipped in the lambda in the QueryParams case. 2015-01-01 15:14:07 +01:00
test first shot at splitting servant into servant, servant-client and servant-docs 2014-11-27 18:28:01 +01:00
.travis.yml travis: build with ghc 7.8 and clone servant from git before building 2014-12-02 17:48:21 +01:00
docs.sh adapt to servant/servant-server split, prepare release 2014-12-10 16:51:05 +01:00
LICENSE add LICENSE files to all projects 2014-12-01 16:38:43 +01:00
README.md polish up cabal file, add a README 2014-12-08 11:10:51 +01:00
servant-client.cabal adapt to servant/servant-server split, prepare release 2014-12-10 16:51:05 +01:00
Setup.hs adapt to servant/servant-server split, prepare release 2014-12-10 16:51:05 +01:00

servant-client

Build Status

servant

This library lets you derive automatically 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