Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Session = ReaderT Application (StateT ClientState IO)
- runSession :: Session a -> Application -> IO a
- withSession :: Application -> Session a -> IO a
- type ClientCookies = Map ByteString SetCookie
- getClientCookies :: Session ClientCookies
- modifyClientCookies :: (ClientCookies -> ClientCookies) -> Session ()
- setClientCookie :: SetCookie -> Session ()
- deleteClientCookie :: ByteString -> Session ()
- request :: Request -> Session SResponse
- srequest :: SRequest -> Session SResponse
- data SRequest = SRequest {}
- data SResponse = SResponse {}
- defaultRequest :: Request
- setPath :: Request -> ByteString -> Request
- setRawPathInfo :: Request -> ByteString -> Request
- assertStatus :: HasCallStack => Int -> SResponse -> Session ()
- assertContentType :: HasCallStack => ByteString -> SResponse -> Session ()
- assertBody :: HasCallStack => ByteString -> SResponse -> Session ()
- assertBodyContains :: HasCallStack => ByteString -> SResponse -> Session ()
- assertHeader :: HasCallStack => CI ByteString -> ByteString -> SResponse -> Session ()
- assertNoHeader :: HasCallStack => CI ByteString -> SResponse -> Session ()
- assertClientCookieExists :: HasCallStack => String -> ByteString -> Session ()
- assertNoClientCookieExists :: HasCallStack => String -> ByteString -> Session ()
- assertClientCookieValue :: HasCallStack => String -> ByteString -> ByteString -> Session ()
Session
type Session = ReaderT Application (StateT ClientState IO) Source #
runSession :: Session a -> Application -> IO a Source #
See also: runSessionWith
.
withSession :: Application -> Session a -> IO a Source #
Synonym for 'flip runSession'
Client Cookies
type ClientCookies = Map ByteString SetCookie Source #
Since 3.0.6
getClientCookies :: Session ClientCookies Source #
Since 3.0.6
modifyClientCookies :: (ClientCookies -> ClientCookies) -> Session () Source #
Since 3.0.6
setClientCookie :: SetCookie -> Session () Source #
Since 3.0.6
deleteClientCookie :: ByteString -> Session () Source #
Since 3.0.6
Requests
srequest :: SRequest -> Session SResponse Source #
Similar to request
, but allows setting the request body as a plain
ByteString
.
SRequest | |
|
A default, blank request.
Since: wai-2.0.0
setRawPathInfo :: Request -> ByteString -> Request Source #
Assertions
assertStatus :: HasCallStack => Int -> SResponse -> Session () Source #
assertContentType :: HasCallStack => ByteString -> SResponse -> Session () Source #
assertBody :: HasCallStack => ByteString -> SResponse -> Session () Source #
assertBodyContains :: HasCallStack => ByteString -> SResponse -> Session () Source #
assertHeader :: HasCallStack => CI ByteString -> ByteString -> SResponse -> Session () Source #
assertNoHeader :: HasCallStack => CI ByteString -> SResponse -> Session () Source #
assertClientCookieExists :: HasCallStack => String -> ByteString -> Session () Source #
Since 3.0.6
assertNoClientCookieExists :: HasCallStack => String -> ByteString -> Session () Source #
Since 3.0.6
assertClientCookieValue :: HasCallStack => String -> ByteString -> ByteString -> Session () Source #
Since 3.0.6