servant-client: automatical derivation of querying functions for servant webservices

[ bsd3, library, servant, web ] [ Propose Tags ]

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
Versions [faq] 0.2, 0.2.1, 0.2.2, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.3.1, 0.4.4, 0.4.4.2, 0.4.4.3, 0.4.4.4, 0.4.4.5, 0.4.4.6, 0.4.4.7, 0.5, 0.6, 0.6.1, 0.7, 0.7.1, 0.8, 0.8.1, 0.9, 0.9.0.1, 0.9.1, 0.9.1.1, 0.10, 0.11, 0.12, 0.12.0.1, 0.13, 0.13.0.1, 0.14, 0.15, 0.16
Dependencies aeson, attoparsec, base (>=4.7 && <5), bytestring, either (<5), exceptions, http-client (<0.5), http-client-tls, http-types, network-uri (>=2.6), safe, servant (>=0.2.2 && <0.3), string-conversions, text, transformers [details]
License BSD-3-Clause
Copyright 2014 Zalora South East Asia Pte Ltd
Author Alp Mestanogullari, Sönke Hahn, Julian K. Arni
Maintainer alpmestan@gmail.com
Revised Revision 2 made by phadej at Sun Dec 10 20:59:46 UTC 2017
Category Web
Home page http://haskell-servant.github.io/
Bug tracker http://github.com/haskell-servant/servant-client/issues
Source repo head: git clone http://github.com/haskell-servant/servant-client.git
Uploaded by jkarni at Mon Mar 2 13:25:40 UTC 2015
Distributions Debian:0.14, Fedora:0.14, LTSHaskell:0.15, NixOS:0.16, Stackage:0.16
Downloads 18413 total (761 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2015-03-02 [all 1 reports]

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees