http-client-session-0.1.2: A simple abstraction over the "http-client" connection manager

Safe HaskellNone
LanguageHaskell2010

HTTPClient.Session

Contents

Synopsis

Documentation

data Session a Source #

A session on an HTTP manager.

Instances

Monad Session Source # 

Methods

(>>=) :: Session a -> (a -> Session b) -> Session b #

(>>) :: Session a -> Session b -> Session b #

return :: a -> Session a #

fail :: String -> Session a #

Functor Session Source # 

Methods

fmap :: (a -> b) -> Session a -> Session b #

(<$) :: a -> Session b -> Session a #

Applicative Session Source # 

Methods

pure :: a -> Session a #

(<*>) :: Session (a -> b) -> Session a -> Session b #

(*>) :: Session a -> Session b -> Session b #

(<*) :: Session a -> Session b -> Session a #

MonadIO Session Source # 

Methods

liftIO :: IO a -> Session a #

MonadError HttpException Session Source # 

Reexports

data Manager :: * #

Keeps track of open connections for keep-alive.

If possible, you should share a single Manager between multiple threads and requests.

Since 0.1.0

data HttpException :: * #

An exception which may be generated by this library

Since: 0.5.0

Constructors

HttpExceptionRequest Request HttpExceptionContent

Most exceptions are specific to a Request. Inspect the HttpExceptionContent value for details on what occurred.

Since: 0.5.0

InvalidUrlException String String

A URL (first field) is invalid for a given reason (second argument).

Since: 0.5.0

data Request :: * #

All information on how to connect to a host and what should be sent in the HTTP request.

If you simply wish to download from a URL, see parseRequest.

The constructor for this data type is not exposed. Instead, you should use either the defaultRequest value, or parseRequest to construct from a URL, and then use the records below to make modifications. This approach allows http-client to add configuration options without breaking backwards compatibility.

For example, to construct a POST request, you could do something like:

initReq <- parseRequest "http://www.example.com/path"
let req = initReq
            { method = "POST"
            }

For more information, please see http://www.yesodweb.com/book/settings-types.

Since 0.1.0

Instances