The servant-yaml package

[Tags:bsd3, library, test]

Servant support for yaml


[Skip to Readme]

Properties

Versions 0.1.0.0
Dependencies base (>=4.7 && <4.10), bytestring (>=0.10.4.0 && <0.11), http-media (>=0.6.2 && <0.7), servant (>=0.4.4.5 && <0.11), yaml (>=0.8.12 && <0.9) [details]
License BSD3
Author Oleg Grenrus <oleg.grenrus@iki.fi>
Maintainer Oleg Grenrus <oleg.grenrus@iki.fi>
Category Web
Home page https://github.com/phadej/servant-yaml#readme
Bug tracker https://github.com/phadej/servant-yaml/issues
Source repository head: git clone https://github.com/phadej/servant-yaml
Uploaded Sun Nov 1 08:37:26 UTC 2015 by phadej
Updated Wed Feb 1 11:30:03 UTC 2017 by phadej to revision 13
Distributions LTSHaskell:0.1.0.0, NixOS:0.1.0.0, Stackage:0.1.0.0, Tumbleweed:0.1.0.0
Downloads 108 total (3 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2015-11-01 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for servant-yaml

Readme for servant-yaml-0.1.0.0

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?