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

[ bsd3, library, servant, web ] [ Propose Tags ] [ Report a vulnerability ]

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

See the client section of the tutorial.

CHANGELOG


[Skip to Readme]

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'.

Versions [RSS] 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, 0.16.0.1, 0.17, 0.18, 0.18.1, 0.18.2, 0.18.3, 0.19, 0.20, 0.20.1, 0.20.2 (info)
Change log CHANGELOG.md
Dependencies aeson (>=0.7 && <1.2), attoparsec (>=0.12 && <0.14), base (>=4.7 && <4.10), base-compat (>=0.9.1 && <0.10), base64-bytestring (>=1.0.0.1 && <1.1), bytestring (>=0.10 && <0.11), exceptions (>=0.8 && <0.9), http-api-data (>=0.3 && <0.4), http-client (>=0.4.18.1 && <0.6), http-client-tls (>=0.2.2 && <0.4), http-media (>=0.6.2 && <0.7), http-types (>=0.8.6 && <0.10), mtl, network-uri (>=2.6 && <2.7), safe (>=0.3.9 && <0.4), servant (>=0.9 && <0.10), string-conversions (>=0.3 && <0.5), text (>=1.2 && <1.3), transformers (>=0.3 && <0.6), transformers-compat (>=0.4 && <0.6) [details]
Tested with ghc >=7.8
License BSD-3-Clause
Copyright 2014-2016 Zalora South East Asia Pte Ltd, Servant Contributors
Author Servant Contributors
Maintainer haskell-servant-maintainers@googlegroups.com
Revised Revision 1 made by phadej at 2017-01-20T21:06:30Z
Category Web
Home page http://haskell-servant.readthedocs.org/
Bug tracker http://github.com/haskell-servant/servant/issues
Source repo head: git clone http://github.com/haskell-servant/servant.git
Uploaded by jkarni at 2016-10-27T11:38:28Z
Distributions Arch:0.20, Debian:0.16.0.1, Fedora:0.19, LTSHaskell:0.20.2, NixOS:0.20, Stackage:0.20.2, openSUSE:0.20.2
Reverse Dependencies 128 direct, 32 indirect [details]
Downloads 53381 total (309 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for servant-client-0.9.1.1

[back to package description]

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 :: Manager -> BaseUrl -> ExceptT String IO [Book]
postNewBook :: Book -> Manager -> BaseUrl -> ExceptT String IO Book
-- 'client' allows you to produce operations to query an API from a client.
(getAllBooks :<|> postNewBook) = client myApi