-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A simple abstraction over the "http-client" connection manager -- -- A simple abstraction over the "http-client" connection manager @package http-client-session @version 0.1.1 module HTTPClient.Session -- | A session on an HTTP manager. data Session a run :: Session a -> Manager -> IO (Either HttpException a) withManager :: (Manager -> IO (Either HttpException a)) -> Session a requestLBSResponse :: Request -> Session (Response ByteString) requestLBSBody :: Request -> Session ByteString requestBSBody :: Request -> Session ByteString -- | 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 Manager :: * data HttpException :: * StatusCodeException :: Status -> ResponseHeaders -> CookieJar -> HttpException InvalidUrlException :: String -> String -> HttpException -- | List of encountered responses containing redirects in reverse -- chronological order; including last redirect, which triggered the -- exception and was not followed. TooManyRedirects :: [Response ByteString] -> HttpException -- | Response containing unparseable redirect. UnparseableRedirect :: Response ByteString -> HttpException TooManyRetries :: HttpException HttpParserException :: String -> HttpException HandshakeFailed :: HttpException OverlongHeaders :: HttpException ResponseTimeout :: HttpException -- | host/port -- -- Note that in old versions of http-client and http-conduit, this -- exception would indicate a failed attempt to create a connection. -- However, since (at least) http-client 0.4, it indicates a timeout -- occurred while trying to establish the connection. For more -- information on this, see: -- -- -- https://github.com/snoyberg/http-client/commit/b86b1cdd91e56ee33150433dedb32954d2082621#commitcomment-10718689 FailedConnectionException :: String -> Int -> HttpException -- | host/port/secure FailedConnectionException2 :: String -> Int -> Bool -> SomeException -> HttpException ExpectedBlankAfter100Continue :: HttpException InvalidStatusLine :: ByteString -> HttpException InvalidHeader :: ByteString -> HttpException InternalIOException :: IOException -> HttpException -- | host/port ProxyConnectException :: ByteString -> Int -> Either ByteString HttpException -> HttpException NoResponseDataReceived :: HttpException TlsException :: SomeException -> HttpException TlsNotSupported :: HttpException -- | Expected size/actual size. -- -- Since 1.9.4 ResponseBodyTooShort :: Word64 -> Word64 -> HttpException -- | Since 1.9.4 InvalidChunkHeaders :: HttpException IncompleteHeaders :: HttpException InvalidDestinationHost :: ByteString -> HttpException -- | Since 0.3 HttpZlibException :: ZlibException -> HttpException -- | Environment name and value -- -- Since 0.4.7 InvalidProxyEnvironmentVariable :: Text -> Text -> HttpException -- | Detect a case where both the content-length header and -- transfer-encoding: chunked are used. Since 0.4.8. -- -- Since 0.4.11 this exception isn't thrown anymore. ResponseLengthAndChunkingBothUsed :: HttpException -- | TLS exception, together with the host and port TlsExceptionHostPort :: SomeException -> ByteString -> Int -> HttpException -- | 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 parseUrl. -- -- The constructor for this data type is not exposed. Instead, you should -- use either the def method to retrieve a default instance, or -- parseUrl 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 <- parseUrl "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 data Request :: * instance Control.Monad.Error.Class.MonadError Network.HTTP.Client.Types.HttpException HTTPClient.Session.Session instance Control.Monad.IO.Class.MonadIO HTTPClient.Session.Session instance GHC.Base.Monad HTTPClient.Session.Session instance GHC.Base.Applicative HTTPClient.Session.Session instance GHC.Base.Functor HTTPClient.Session.Session