Safe Haskell | None |
---|---|
Language | Haskell2010 |
- 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
- data Manager :: *
- data HttpException :: *
- data Request :: *
Documentation
A session on an HTTP manager.
withManager :: (Manager -> IO (Either HttpException a)) -> Session a Source #
requestBSBody :: Request -> Session ByteString Source #
Reexports
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
HttpExceptionRequest Request HttpExceptionContent | Most exceptions are specific to a Since: 0.5.0 |
InvalidUrlException String String | A URL (first field) is invalid for a given reason (second argument). Since: 0.5.0 |
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