servant-yaml: Servant support for yaml

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

Servant support for yaml.


[Skip to Readme]
Versions 0.1.0.0
Dependencies base (>=4.7 && <4.13), bytestring (>=0.10.4.0 && <0.11), http-media (>=0.6.2 && <0.8), servant (>=0.4.4.5 && <0.15), yaml (>=0.8.12 && <0.12) [details]
License BSD-3-Clause
Author Oleg Grenrus <oleg.grenrus@iki.fi>
Maintainer Oleg Grenrus <oleg.grenrus@iki.fi>
Revised Revision 22 made by phadej at Mon Oct 15 18:08:27 UTC 2018
Category Web, Servant
Home page https://github.com/haskell-servant/servant-yaml#readme
Bug tracker https://github.com/haskell-servant/servant-yaml/issues
Source repo head: git clone https://github.com/haskell-servant/servant-yaml
Uploaded by phadej at Sun Nov 1 08:37:26 UTC 2015
Distributions LTSHaskell:0.1.0.0, NixOS:0.1.0.0
Downloads 2790 total (16 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-11-01 [all 1 reports]
Hackage Matrix CI

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


Readme for servant-yaml-0.1.0.0

[back to package description]

servant-yaml

Servant support for yaml

Build Status Hackage Stackage LTS 2 Stackage LTS 3 Stackage Nightly

Example

Check example/Main.hs for an example:

curl -i -H "Content-Type: application/x-yaml" -H "Accept: application/x-yaml" -X POST --data-binary @example.yaml 'localhost:8000/foo'

$ curl -i localhost:8000
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Sun, 01 Nov 2015 08:10:01 GMT
Server: Warp/3.0.13.1
Content-Type: application/x-yaml

foo: 42
bar: Yaml!

$ curl -i -H "Accept: application/json" localhost:8000
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Sun, 01 Nov 2015 08:14:08 GMT
Server: Warp/3.0.13.1
Content-Type: application/json

{"foo":42,"bar":"Yaml!"

$ cat example.yaml
bar: "JSON?"
foo: 1337

$ curl -i -H "Content-Type: application/x-yaml" -H "Accept: application/x-yaml" -X POST --data-binary @example.yaml 'localhost:8000/foo'
HTTP/1.1 201 Created
Transfer-Encoding: chunked
Date: Sun, 01 Nov 2015 08:15:21 GMT
Server: Warp/3.0.13.1
Content-Type: application/x-yaml

foo: 1337
bar: JSON?