HTTP-3001.0.4Source codeContentsIndex
Network.Browser
Portabilitynon-portable (not tested)
Stabilityexperimental
Maintainerbjorn@bringert.net
Description
An HTTP/1.1 compatible wrapper for the HTTP module.
Synopsis
data BrowserState
data BrowserAction a
data Cookie
data Form = Form RequestMethod URI [FormVar]
data Proxy
= NoProxy
| Proxy String (Maybe Authority)
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 {
auRealm :: String
auUsername :: String
auPassword :: String
auNonce :: String
auAlgorithm :: Maybe Algorithm
auDomain :: [URI]
auOpaque :: Maybe String
auQop :: [Qop]
}
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
show/hide Instances
data BrowserAction a Source
show/hide Instances
data Cookie Source
show/hide Instances
data Form Source
Constructors
Form RequestMethod URI [FormVar]
data Proxy Source
Specifies if a proxy should be used for the request.
Constructors
NoProxyDon't use a proxy.
Proxy String (Maybe Authority)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.
request :: Request -> BrowserAction (URI, Response)Source
setAllowRedirects :: Bool -> BrowserAction ()Source
getAllowRedirects :: BrowserAction BoolSource
data Authority Source
Constructors
AuthBasic
auRealm :: String
auUsername :: String
auPassword :: String
auSite :: URI
AuthDigest
auRealm :: String
auUsername :: String
auPassword :: String
auNonce :: String
auAlgorithm :: Maybe Algorithm
auDomain :: [URI]
auOpaque :: Maybe String
auQop :: [Qop]
getAuthorities :: BrowserAction [Authority]Source
Interacting with browser state:
setAuthorities :: [Authority] -> BrowserAction ()Source
addAuthority :: Authority -> BrowserAction ()Source
getAuthorityGen :: BrowserAction (URI -> String -> IO (Maybe (String, String)))Source
setAuthorityGen :: (URI -> String -> IO (Maybe (String, String))) -> BrowserAction ()Source
setAllowBasicAuth :: Bool -> BrowserAction ()Source
setCookieFilter :: (URI -> Cookie -> IO Bool) -> BrowserAction ()Source
defaultCookieFilter :: URI -> Cookie -> IO BoolSource
userCookieFilter :: URI -> Cookie -> IO BoolSource
getCookies :: BrowserAction [Cookie]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 -> RequestSource
formToRequest :: Form -> RequestSource
uriDefaultTo :: URI -> URI -> URISource
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 -> URISource
Produced by Haddock version 2.6.0