HTTP-400004: A library for client-side HTTP

Portabilitynon-portable (not tested)
Stabilityexperimental
MaintainerSigbjorn Finne <sigbjorn.finne@gmail.com>

Network.Browser

Description

An HTTP/1.1 compatible wrapper for the HTTP module.

Synopsis

Documentation

data BrowserState connection Source

Instances

data BrowserAction conn a Source

Instances

data Cookie Source

Instances

data Form Source

Constructors

Form RequestMethod URI [FormVar]

data Proxy Source

Specifies if a proxy should be used for the request.

Constructors

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 conn a -> IO aSource

Apply a browser action to a state.

request :: HStream ty => Request ty -> BrowserAction (HandleStream ty) (URI, Response ty)Source

getBrowserState :: BrowserAction t (BrowserState t)Source

withBrowserState :: BrowserState t -> BrowserAction t a -> BrowserAction t aSource

setAllowRedirects :: Bool -> BrowserAction t () Source

getAllowRedirects :: BrowserAction t Bool Source

data Authority Source

Constructors

getAuthorities :: BrowserAction t [Authority]Source

Interacting with browser state:

setAuthorities :: [Authority] -> BrowserAction t () Source

addAuthority :: Authority -> BrowserAction t () Source

getAuthorityGen :: BrowserAction t (URI -> String -> IO (Maybe (String, String)))Source

setAuthorityGen :: (URI -> String -> IO (Maybe (String, String))) -> BrowserAction t () Source

setAllowBasicAuth :: Bool -> BrowserAction t () Source

setCookieFilter :: (URI -> Cookie -> IO Bool) -> BrowserAction t () Source

defaultCookieFilter :: URI -> Cookie -> IO Bool Source

userCookieFilter :: URI -> Cookie -> IO Bool Source

getCookies :: BrowserAction t [Cookie]Source

setCookies :: [Cookie] -> BrowserAction t () Source

addCookie :: Cookie -> BrowserAction t () Source

Adds a cookie to the browser state, removing duplicates.

setErrHandler :: (String -> IO ()) -> BrowserAction t () Source

setOutHandler :: (String -> IO ()) -> BrowserAction t () Source

setEventHandler :: (BrowserEvent ty -> BrowserAction ty ()) -> BrowserAction ty () Source

data BrowserEvent ty Source

BrowserEvent is the event record type that a user-defined handler, set via setEventHandler , will be passed. It indicates various state changes in the processing of a given Request ID.

Constructors

data BrowserEventType ty Source

BrowserEventType is the enumerated list of events that the browser internals will report to a user-defined event handler.

Constructors

type RequestID = Int Source

setProxy :: Proxy -> BrowserAction t () Source

setDebugLog :: Maybe String -> BrowserAction t () Source

out :: String -> BrowserAction t () Source

err :: String -> BrowserAction t () Source

ioAction :: IO a -> BrowserAction t aSource

Do an io action

defaultGETRequest :: URI -> Request_String Source

defaultGETRequest_ :: BufferType a => URI -> Request aSource

formToRequest :: Form -> Request_String 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

AltStyle によって変換されたページ (->オリジナル) /