iterio-server-0.3: Library for building servers with IterIO

Safe HaskellSafe

Data.IterIO.Http.Support.Responses

Description

Utility functions for responding to HTTP requests from within an Action.

Synopsis

Documentation

renderSource

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.

redirectToSource

Arguments

:: Monad m 
=> String

The path to redirect to

-> Action t b m () 

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.