| Safe Haskell | Safe |
|---|
Data.IterIO.Http.Support.Responses
Description
Utility functions for responding to HTTP requests from within an Action.
- render :: Monad m => String -> ByteString -> Action t b m ()
- redirectTo :: Monad m => String -> Action t b m ()
- redirectBack :: Monad m => Action t b m ()
- respond404 :: Monad m => Action t b m ()
- respondStat :: Monad m => HttpStatus -> Action t b m ()
Documentation
Arguments
| :: Monad m | |
| => String | The mime-type of the response (commonly "text/html") |
| -> ByteString | The response body |
| -> Action t b m () |
Responds to the client with a 200 (Success) response with the given body
and mime-type.
Responds to the client with a 303 (Temporary Redirect) response to the given
path.
redirectBack :: Monad m => Action t b m ()Source
Redirect "back" according to the "referer" header.
respond404 :: Monad m => Action t b m ()Source
Responds to the client with an empty 404 (Not Found) response.
respondStat :: Monad m => HttpStatus -> Action t b m ()Source
Replaces the HTTP status in the current HttpResp with the given
HttpStatus.