- class Monad m => Web m where
- type WebRes m
- webRec :: WebRec m
- webDocumentRoot :: m FilePath
- webContainerUri :: m URI
- webRequestUri :: m URI
- webPathInfo :: m String
- webMethod :: m String
- webGetBody :: m ByteString
- webGetParams :: m WebParams
- webGetHeaders :: m WebHeaders
- webGetCookies :: m WebCookies
- webSetStatus :: Int -> Maybe String -> m ()
- webSendBSL :: ByteString -> m (WebRes m)
- webSetHeader :: String -> String -> m ()
- webSetCookie :: Cookie -> m ()
- webUnsetCookie :: Cookie -> m ()
- webLog :: String -> Priority -> String -> m ()
- webGetRepls :: m [String]
- webWithRepls :: [String] -> m a -> m a
- webFail :: String -> m a
- webRunFromRq :: FromRq a => m (Either String a)
- webSendError :: Int -> String -> m (WebRes m)
- webGetHeader :: String -> m (Maybe String)
- webGetParam :: String -> m (Maybe String)
- class (MonadIO m, Web m) => WebIO m
- 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)
- data WebRec m = WebRec {
- web_documentRoot :: m FilePath
- web_containerUri :: m URI
- web_requestUri :: m URI
- web_pathInfo :: m String
- web_method :: m String
- web_getBody :: m ByteString
- web_getParams :: m WebParams
- web_getHeaders :: m WebHeaders
- web_getCookies :: m WebCookies
- web_setStatus :: Int -> Maybe String -> m ()
- web_sendBSL :: ByteString -> m (WebRes m)
- web_setHeader :: String -> String -> m ()
- web_setCookie :: Cookie -> m ()
- web_unsetCookie :: Cookie -> m ()
- web_log :: String -> Priority -> String -> m ()
- web_getRepls :: m [String]
- web_fail :: forall a. String -> m a
- web_withRepls :: forall a. [String] -> m a -> m a
- 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
You may either define webRec
or all of webDocumentRoot
,
webContainerUri
, webPathInfo
, webMethod
, webGetBody
,
webGetParams
, webGetHeaders
, webGetCookies
, webSetStatus
,
webSendBSL
, webSetHeader
, webSetCookie
, webUnsetCookie
,
webLog
and webGetRepls
, webWithRepls
and webFail
.
webDocumentRoot :: m FilePathSource
webContainerUri :: m URISource
webRequestUri :: m URISource
webPathInfo :: m StringSource
webGetBody :: m ByteStringSource
webGetParams :: m WebParamsSource
webGetHeaders :: m WebHeadersSource
webGetCookies :: m WebCookiesSource
webSetStatus :: Int -> Maybe String -> m ()Source
webSendBSL :: ByteString -> m (WebRes m)Source
webSetHeader :: String -> String -> m ()Source
webSetCookie :: Cookie -> m ()Source
webUnsetCookie :: Cookie -> m ()Source
webLog :: String -> Priority -> String -> m ()Source
webGetRepls :: m [String]Source
webWithRepls :: [String] -> m a -> m aSource
webFail :: String -> m aSource
webRunFromRq :: FromRq a => m (Either String a)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
WebRec | |
|
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