BSD-3-Clause licensed and maintained by Oleg Grenrus
This version can be pinned in stack with:servant-yaml-0.1.0.1@sha256:9c1e6bee1d9bfda3f4b9efdba38317c5951a6a1f18f51eec8f6759a85ba99769,1512

Module documentation for 0.1.0.1

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?