git.iko.soy/typeable/servant
on master help sign in
Add / expand the documentation of the NoContent case.
commit52b1a233fe4a0ea406963157dfed8dd138636279 authorAndres Loeh <andres@well-typed.com> dateThu 28 Jan 2016, 13:30 (11 years ago) parent21426a2
1 file changed+6−1
doc/tutorial/ApiType.lhs+6−1
doc/tutorial/ApiType.lhs+6−1
@@ -149,10 +149,15 @@ type UserAPI5 = "user" :> Capture "userid" Integer :> Get '[JSON] User
149149 -- except that we explicitly say that "userid"
150150 -- must be an integer
151151
152− :<|> "user" :> Capture "userid" Integer :> Delete '[] ()
152+ :<|> "user" :> Capture "userid" Integer :> DeleteNoContent '[JSON] NoContent
153153 -- equivalent to 'DELETE /user/:userid'
154154```
155155
156+In the second case, `DeleteNoContent` specifies a 204 response code,
157+`JSON` specifies the content types on which the handler will match,
158+and `NoContent` is a Haskell type isomorphic to `()` used to represent
159+a trivial piece of information.
160+
156161### `QueryParam`, `QueryParams`, `QueryFlag`
157162
158163`QueryParam`, `QueryParams` and `QueryFlag` are about query string