servant/servant-server
Andres Loeh a551eb62e2 Do the accept check before the body check.
This is a reasonably simple attempt at fixing #460.
By moving the accept check to a place before the body check,
we can make it recoverable (the body check is irreversible,
so everything done after the body check has to fail fatally).

The advantage is that we can now specify routes offering
different content types modularly. Failure to match one
is not fatal, and will result in subsequent routes being
tried.

The disadvantage is that we hereby bump the error priority
of the 406 status code. If a request contains a bad accept
header and a bad body, we now get 406 rather than 400. This
deviates from the HTTP decision diagram we try to follow,
but seems like an acceptable compromise for now.
2016-04-15 10:54:22 +02:00
..
example Introduce a Handler alias for ExceptT ServantErr IO 2016-04-11 22:27:29 -07:00
include less OverlappingInstances noise 2016-01-04 13:09:11 -05:00
src Do the accept check before the body check. 2016-04-15 10:54:22 +02:00
test Do the accept check before the body check. 2016-04-15 10:54:22 +02:00
CHANGELOG.md Do the accept check before the body check. 2016-04-15 10:54:22 +02:00
LICENSE Change copyright to servant contributors 2016-01-20 16:58:29 +01:00
README.md update servant-server README 2015-10-10 19:31:03 +02:00
servant-server.cabal Merge pull request #388 from bgamari/master 2016-04-13 15:09:16 +02:00
Setup.hs stylish haskell changes 2015-08-18 00:07:12 +02:00
tinc.yaml Use tinc on travis 2015-11-05 09:32:13 +08:00

servant-server

servant

This library lets you implement an HTTP server with handlers for each endpoint of a servant API, handling most of the boilerplate for you.

Getting started

We've written a tutorial guide that introduces the core types and features of servant. After this article, you should be able to write your first servant webservices, learning the rest from the haddocks' examples.