If you use Header in one of the endpoints for your API,
+ this automatically requires your server-side handler to be a function
+ that takes an argument of the type specified by Header.
+ This lets servant worry about extracting it from the request and turning
+ it into a value of the type you specify.
\ No newline at end of file
diff --git a/Servant-API-Sub.html b/Servant-API-Sub.html
index 464947fd..98890f20 100644
--- a/Servant-API-Sub.html
+++ b/Servant-API-Sub.html
@@ -14,7 +14,20 @@ type MyApi = "hello" :> "world" :> Get World
If you use Header in one of the endpoints for your API,
+ this automatically requires your server-side handler to be a function
+ that takes an argument of the type specified by Header.
+ This lets servant worry about extracting it from the request and turning
+ it into a value of the type you specify.
If you use QueryFlag "published" in one of the endpoints for your API,
this automatically requires your server-side handler to be a function
that takes an argument of type Bool.
Example:
type MyApi = "books" :> QueryFlag "published" :> Get [Book]
@@ -53,4 +66,4 @@ server :: Server MyApi
server = postBook
where postBook :: Book -> EitherT (Int, String) IO Book
postBook book = ...insert into your db...