Safe Haskell | Safe |
---|
Defines the Action
monad which abstracts some of the details of handling
HTTP requests with IterIO.
- type Action t b m a = StateT (ActionState t b m) m a
- data ActionState t b m = ActionState {
- actionReq :: HttpReq t
- actionResp :: HttpResp m
- actionParams :: [Param]
- actionBody :: b
- data Param = Param {
- paramKey :: ByteString
- paramValue :: ByteString
- paramHeaders :: [(ByteString, ByteString)]
- params :: Monad m => Action t b m [Param]
- param :: Monad m => ByteString -> Action t b m (Maybe Param)
- paramVal :: Monad m => ByteString -> Action t b m ByteString
- paramValM :: Monad m => (ByteString -> a) -> ByteString -> Action t b m (Maybe a)
- setParams :: Monad m => [Param] -> Action t b m [Param]
- getBody :: Monad m => Action t b m b
- getHttpReq :: Monad m => Action t b m (HttpReq t)
- setSession :: Monad m => String -> Action t b m ()
- destroySession :: Monad m => Action t b m ()
- requestHeader :: Monad m => ByteString -> Action t b m (Maybe ByteString)
Documentation
type Action t b m a = StateT (ActionState t b m) m aSource
data ActionState t b m Source
ActionState | |
|
A request parameter from a form field in the HTTP body
Param | |
|
paramVal :: Monad m => ByteString -> Action t b m ByteStringSource
Force get parameter value
paramValM :: Monad m => (ByteString -> a) -> ByteString -> Action t b m (Maybe a)Source
Get (maybe) paramater value and transform it with f
setSession :: Monad m => String -> Action t b m ()Source
Sets a the value for "_sess" in the cookie to the given string.
destroySession :: Monad m => Action t b m ()Source
Removes the "_sess" key-value pair from the cookie.
requestHeader :: Monad m => ByteString -> Action t b m (Maybe ByteString)Source
Returns the value of an Http Header from the request if it exists otherwise
Nothing