Safe Haskell | Safe-Infered |
---|
- data BrowserState
- type BrowserAction = StateT BrowserState (ResourceT IO)
- browse :: Manager -> BrowserAction a -> ResourceT IO a
- makeRequest :: Request (ResourceT IO) -> BrowserAction (Response (Source (ResourceT IO) ByteString))
- defaultState :: Manager -> BrowserState
- getBrowserState :: BrowserAction BrowserState
- setBrowserState :: BrowserState -> BrowserAction ()
- withBrowserState :: BrowserState -> BrowserAction a -> BrowserAction a
- getMaxRedirects :: BrowserAction Int
- setMaxRedirects :: Int -> BrowserAction ()
- getMaxRetryCount :: BrowserAction Int
- setMaxRetryCount :: Int -> BrowserAction ()
- getAuthorities :: BrowserAction (Request (ResourceT IO) -> Maybe (ByteString, ByteString))
- setAuthorities :: (Request (ResourceT IO) -> Maybe (ByteString, ByteString)) -> BrowserAction ()
- getCookieFilter :: BrowserAction (Request (ResourceT IO) -> Cookie -> IO Bool)
- setCookieFilter :: (Request (ResourceT IO) -> Cookie -> IO Bool) -> BrowserAction ()
- getCookieJar :: BrowserAction CookieJar
- setCookieJar :: CookieJar -> BrowserAction ()
- getCurrentProxy :: BrowserAction (Maybe Proxy)
- setCurrentProxy :: Maybe Proxy -> BrowserAction ()
- getUserAgent :: BrowserAction ByteString
- setUserAgent :: ByteString -> BrowserAction ()
- getManager :: BrowserAction Manager
- setManager :: Manager -> BrowserAction ()
Documentation
data BrowserState Source
type BrowserAction = StateT BrowserState (ResourceT IO)Source
browse :: Manager -> BrowserAction a -> ResourceT IO aSource
Do the browser action with the given manager
makeRequest :: Request (ResourceT IO) -> BrowserAction (Response (Source (ResourceT IO) ByteString))Source
Make a request, using all the state in the current BrowserState
getBrowserState :: BrowserAction BrowserStateSource
You can save and restore the state at will
withBrowserState :: BrowserState -> BrowserAction a -> BrowserAction aSource
getMaxRedirects :: BrowserAction IntSource
The number of redirects to allow
getMaxRetryCount :: BrowserAction IntSource
The number of times to retry a failed connection
getAuthorities :: BrowserAction (Request (ResourceT IO) -> Maybe (ByteString, ByteString))Source
A user-provided function that provides optional authorities. This function gets run on all requests before they get sent out. The output of this function is applied to the request.
setAuthorities :: (Request (ResourceT IO) -> Maybe (ByteString, ByteString)) -> BrowserAction ()Source
getCookieFilter :: BrowserAction (Request (ResourceT IO) -> Cookie -> IO Bool)Source
Each new Set-Cookie the browser encounters will pass through this filter. Only cookies that pass the filter (and are already valid) will be allowed into the cookie jar
setCookieFilter :: (Request (ResourceT IO) -> Cookie -> IO Bool) -> BrowserAction ()Source
getCookieJar :: BrowserAction CookieJarSource
All the cookies!
getCurrentProxy :: BrowserAction (Maybe Proxy)Source
An optional proxy to send all requests through
getUserAgent :: BrowserAction ByteStringSource
What string to report our user-agent as
getManager :: BrowserAction ManagerSource
The active manager, managing the connection pool