okResponse :: String -> HttpResponse notFoundResponse :: [Char] -> HttpResponse badQueryResponse :: String -> HttpResponse notImplementedResponse :: String -> HttpResponse
These functions provide convenient ways to construct common HTTP responses containing HTML documents.
okResponse
creates a normal response.
notFoundResponse
generates an error response, indicated that the
server does not have the document indicated by the URL.
badQueryResponse
generates an error response,
to indicate that something is wrong with the request (e.g., a bad URL).
notImplementedResponse
generates an error response, to indicate that something is wrong in the server.
In all cases, the content is marked as
having Mime type text/html
, so the String
argument should be
some HTML text.
okResponse = okResponse' htmlType notFoundResponse = notImplementedResponse' htmlType badQueryResponse = badQueryResponse' htmlType notImplementedResponse = notImplementedResponse' htmlType