Portability | non-portable (not tested) |
---|---|
Stability | experimental |
Maintainer | bjorn@bringert.net |
Network.Browser
Description
An HTTP/1.1 compatible wrapper for the HTTP module.
Synopsis
- data BrowserState
- data BrowserAction a
- data Cookie = MkCookie {}
- data Form = Form RequestMethod URI [FormVar]
- data Proxy
- browse :: BrowserAction a -> IO a
- request :: Request -> BrowserAction (URI, Response)
- setAllowRedirects :: Bool -> BrowserAction ()
- getAllowRedirects :: BrowserAction Bool
- data Authority
- = AuthBasic {
- auRealm :: String
- auUsername :: String
- auPassword :: String
- auSite :: URI
- | AuthDigest { }
- = AuthBasic {
- getAuthorities :: BrowserAction [Authority]
- setAuthorities :: [Authority] -> BrowserAction ()
- addAuthority :: Authority -> BrowserAction ()
- getAuthorityGen :: BrowserAction (URI -> String -> IO (Maybe (String, String)))
- setAuthorityGen :: (URI -> String -> IO (Maybe (String, String))) -> BrowserAction ()
- setAllowBasicAuth :: Bool -> BrowserAction ()
- setCookieFilter :: (URI -> Cookie -> IO Bool) -> BrowserAction ()
- defaultCookieFilter :: URI -> Cookie -> IO Bool
- userCookieFilter :: URI -> Cookie -> IO Bool
- getCookies :: BrowserAction [Cookie]
- setCookies :: [Cookie] -> BrowserAction ()
- addCookie :: Cookie -> BrowserAction ()
- setErrHandler :: (String -> IO ()) -> BrowserAction ()
- setOutHandler :: (String -> IO ()) -> BrowserAction ()
- setProxy :: Proxy -> BrowserAction ()
- setDebugLog :: Maybe String -> BrowserAction ()
- out :: String -> BrowserAction ()
- err :: String -> BrowserAction ()
- ioAction :: IO a -> BrowserAction a
- defaultGETRequest :: URI -> Request
- formToRequest :: Form -> Request
- uriDefaultTo :: URI -> URI -> URI
- uriTrimHost :: URI -> URI
Documentation
data BrowserState Source
Instances
data BrowserAction a Source
Instances
Constructors
Constructors
Specifies if a proxy should be used for the request.
Constructors
Don't use a proxy.
Use the proxy given. Should be of the form http://host:port, host, host:port, or http://host
browse :: BrowserAction a -> IO aSource
Apply a browser action to a state.
Constructors
Fields
- auRealm :: String
- auUsername :: String
- auPassword :: String
- auSite :: URI
getAuthorities :: BrowserAction [Authority]Source
Interacting with browser state:
setAuthorities :: [Authority] -> BrowserAction () Source
getAuthorityGen :: BrowserAction (URI -> String -> IO (Maybe (String, String)))Source
setAuthorityGen :: (URI -> String -> IO (Maybe (String, String))) -> BrowserAction () Source
setCookieFilter :: (URI -> Cookie -> IO Bool) -> BrowserAction () Source
setCookies :: [Cookie] -> BrowserAction () Source
addCookie :: Cookie -> BrowserAction () Source
Adds a cookie to the browser state, removing duplicates.
setErrHandler :: (String -> IO ()) -> BrowserAction () Source
setOutHandler :: (String -> IO ()) -> BrowserAction () Source
setProxy :: Proxy -> BrowserAction () Source
setDebugLog :: Maybe String -> BrowserAction () Source
out :: String -> BrowserAction () Source
err :: String -> BrowserAction () Source
ioAction :: IO a -> BrowserAction aSource
Do an io action
defaultGETRequest :: URI -> Request Source
formToRequest :: Form -> Request Source
uriDefaultTo :: URI -> URI -> URI Source
Returns a URI that is consistent with the first argument uri when read in the context of a second. If second argument is not sufficient context for determining a full URI then anarchy reins.
uriTrimHost :: URI -> URI Source