Portability | non-portable (not tested) |
---|---|
Stability | experimental |
Maintainer | bjorn@bringert.net |
An HTTP/1.1 compatible wrapper for the HTTP module.
- 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
Form RequestMethod URI [FormVar] |
Specifies if a proxy should be used for the request.
NoProxy | Don'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.
AuthBasic | |
| |
AuthDigest | |
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
out :: String -> BrowserAction ()Source
err :: String -> BrowserAction ()Source
ioAction :: IO a -> BrowserAction aSource
Do an io action
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