- class Monad m => Web m where
- type WebRes m
- webDocumentRoot :: m FilePath
- webContainerUri :: m URI
- webRequestUri :: m URI
- webPathInfo :: m String
- webMethod :: m String
- webGetBody :: m ByteString
- webGetParams :: m [(String, String)]
- webGetHeaders :: m [(String, String)]
- webGetCookies :: m [(String, String)]
- webSetStatus :: Int -> Maybe String -> m ()
- webSendBSL :: ByteString -> m (WebRes m)
- webSetHeader :: String -> String -> m ()
- webFail :: String -> m a
- webSetCookie :: Cookie -> m ()
- webUnsetCookie :: Cookie -> m ()
- webGetRepls :: m [String]
- webWithRepls :: [String] -> m a -> m a
- webRunFromRq :: FromRq a => m (Either String a)
- webLog :: String -> Priority -> String -> m ()
- webSendError :: Int -> String -> m (WebRes m)
- webGetHeader :: String -> m (Maybe String)
- webGetParam :: String -> m (Maybe String)
- class (MonadIO m, Web m) => WebIO m
- class MonadPlus m => RqAccess m where
- class FromRq a where
- class ToWebRes a where
- toWebContentType :: a -> String
- toWebBody :: a -> ByteString
- toWebRes :: Web m => a -> m (WebRes m)
- type WebWebRes m = m (WebRes m)
- webRepl :: Web m => Int -> m String
- webOk :: (Web m, ToWebRes a) => a -> m (WebRes m)
- webNotFound :: Web m => [Char] -> m (WebRes m)
- webFileNotFound :: Web m => [Char] -> m (WebRes m)
- webBadRequest :: Web m => [Char] -> m (WebRes m)
- webSendString :: Web m => String -> m (WebRes m)
- webGetCookie :: Web m => String -> m (Maybe String)
- webRedirect :: Web m => Bool -> String -> m (WebRes m)
- webWithData :: (Web m, FromRq a) => (a -> m (WebRes m)) -> m (WebRes m)
- webCheckData :: (Web m, FromRq a) => (a -> m (WebRes m)) -> (String -> m (WebRes m)) -> m (WebRes m)
- webSendFile :: WebIO m => FilePath -> m (WebRes m)
- notEmpty :: Monad m => m String -> m String
- optional :: MonadPlus m => m a -> m (Maybe a)
- webLogNotice :: Web m => String -> m ()
- webLogTrace :: Web m => String -> m ()
- webLogDebug :: Web m => String -> m ()
- data Cookie = Cookie {}
- newCookie :: String -> String -> Cookie
- findCookie :: String -> String -> Maybe String
- deleteCookie :: Cookie -> Cookie
- showCookie :: Cookie -> String
- readCookies :: String -> [(String, String)]
Documentation
class Monad m => Web m whereSource
webDocumentRoot :: m FilePathSource
webContainerUri :: m URISource
webRequestUri :: m URISource
webPathInfo :: m StringSource
webGetBody :: m ByteStringSource
webGetParams :: m [(String, String)]Source
webGetHeaders :: m [(String, String)]Source
webGetCookies :: m [(String, String)]Source
webSetStatus :: Int -> Maybe String -> m ()Source
webSendBSL :: ByteString -> m (WebRes m)Source
webSetHeader :: String -> String -> m ()Source
webFail :: String -> m aSource
webSetCookie :: Cookie -> m ()Source
webUnsetCookie :: Cookie -> m ()Source
webGetRepls :: m [String]Source
webWithRepls :: [String] -> m a -> m aSource
webRunFromRq :: FromRq a => m (Either String a)Source
webLog :: String -> Priority -> String -> m ()Source
webSendError :: Int -> String -> m (WebRes m)Source
webGetHeader :: String -> m (Maybe String)Source
webGetParam :: String -> m (Maybe String)Source
toWebContentType :: a -> StringSource
toWebBody :: a -> ByteStringSource
webNotFound :: Web m => [Char] -> m (WebRes m)Source
webFileNotFound :: Web m => [Char] -> m (WebRes m)Source
webBadRequest :: Web m => [Char] -> m (WebRes m)Source
webSendString :: Web m => String -> m (WebRes m)Source
webCheckData :: (Web m, FromRq a) => (a -> m (WebRes m)) -> (String -> m (WebRes m)) -> m (WebRes m)Source
webSendFile :: WebIO m => FilePath -> m (WebRes m)Source
webLogNotice :: Web m => String -> m ()Source
webLogTrace :: Web m => String -> m ()Source
webLogDebug :: Web m => String -> m ()Source
data Cookie
Contains all information about a cookie set by the server.
Cookie | |
|
Construct a cookie with only name and value set. This client will expire when the browser sessions ends, will only be sent to the server and path which set it and may be sent using any means.
:: String | Cookie name |
-> String | Semicolon separated list of name-value pairs |
-> Maybe String | Cookie value, if found |
Get the value of a cookie from a string on the form
"cookieName1=cookieValue1;...;cookieName2=cookieValue2"
.
This is the format of the Cookie
HTTP header.
:: Cookie | Cookie to delete. The only fields that matter
are |
-> Cookie |
Delete a cookie from the client by setting the cookie expiry date to a date in the past.
showCookie :: Cookie -> String
Show a cookie on the format used as the value of the Set-Cookie header.
Gets all the cookies from a Cookie: header value