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

Safe HaskellSafe-Infered

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 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 m () 

Responds to the client with a 303 (Temporary Redirect) response to the given path.

respond404 :: Monad m => Action t m ()Source

Responds to the client with an empty 404 (Not Found) response.

respondStat :: Monad m => HttpStatus -> Action t m ()Source

Replaces the HTTP status in the current HttpResp with the given HttpStatus.