| Safe Haskell | None |
|---|
Network.HTTP.Client.Types
- data Connection = Connection {
- connectionRead :: !(IO ByteString)
- connectionUnread :: !(ByteString -> IO ())
- connectionWrite :: !(ByteString -> IO ())
- connectionClose :: !(IO ())
- data StatusHeaders = StatusHeaders !Status !HttpVersion !RequestHeaders
- data HttpException
- = StatusCodeException Status ResponseHeaders CookieJar
- | InvalidUrlException String String
- | TooManyRedirects [Response ByteString]
- | UnparseableRedirect (Response ByteString)
- | TooManyRetries
- | HttpParserException String
- | HandshakeFailed
- | OverlongHeaders
- | ResponseTimeout
- | FailedConnectionException String Int
- | ExpectedBlankAfter100Continue
- | InvalidStatusLine ByteString
- | InvalidHeader ByteString
- | InternalIOException IOException
- | ProxyConnectException ByteString Int (Either ByteString HttpException)
- | NoResponseDataReceived
- | TlsException SomeException
- | TlsNotSupported
- | ResponseBodyTooShort Word64 Word64
- | InvalidChunkHeaders
- | IncompleteHeaders
- data Cookie = Cookie {}
- newtype CookieJar = CJ {}
- data Proxy = Proxy {
- proxyHost :: ByteString
- proxyPort :: Int
- data RequestBody
- = RequestBodyLBS !ByteString
- | RequestBodyBS !ByteString
- | RequestBodyBuilder !Int64 !Builder
- | RequestBodyStream !Int64 !(GivesPopper ())
- | RequestBodyStreamChunked !(GivesPopper ())
- simplify :: RequestBody -> Either (Int64, Builder) (Maybe Int64, GivesPopper ())
- builderToStream :: (Int64, Builder) -> (Maybe Int64, GivesPopper ())
- type Popper = IO ByteString
- type NeedsPopper a = Popper -> IO a
- type GivesPopper a = NeedsPopper a -> IO a
- data Request = Request {
- method :: Method
- secure :: Bool
- host :: ByteString
- port :: Int
- path :: ByteString
- queryString :: ByteString
- requestHeaders :: RequestHeaders
- requestBody :: RequestBody
- proxy :: Maybe Proxy
- hostAddress :: Maybe HostAddress
- rawBody :: Bool
- decompress :: ContentType -> Bool
- redirectCount :: Int
- checkStatus :: Status -> ResponseHeaders -> CookieJar -> Maybe SomeException
- responseTimeout :: Maybe Int
- getConnectionWrapper :: Maybe Int -> HttpException -> IO (ConnRelease, Connection, ManagedConn) -> IO (Maybe Int, (ConnRelease, Connection, ManagedConn))
- cookieJar :: Maybe CookieJar
- type ContentType = ByteString
- data ConnReuse
- type ConnRelease = ConnReuse -> IO ()
- data ManagedConn
- data Response body = Response {}
- responseClose :: Response a -> IO ()
- newtype ResponseClose = ResponseClose {
- runResponseClose :: IO ()
Documentation
data Connection Source
Constructors
| Connection | |
Fields
| |
data HttpException Source
Constructors
| StatusCodeException Status ResponseHeaders CookieJar | |
| InvalidUrlException String String | |
| TooManyRedirects [Response ByteString] | List of encountered responses containing redirects in reverse chronological order; including last redirect, which triggered the exception and was not followed. |
| UnparseableRedirect (Response ByteString) | Response containing unparseable redirect. |
| TooManyRetries | |
| HttpParserException String | |
| HandshakeFailed | |
| OverlongHeaders | |
| ResponseTimeout | |
| FailedConnectionException String Int | host/port |
| ExpectedBlankAfter100Continue | |
| InvalidStatusLine ByteString | |
| InvalidHeader ByteString | |
| InternalIOException IOException | |
| ProxyConnectException ByteString Int (Either ByteString HttpException) | host/port |
| NoResponseDataReceived | |
| TlsException SomeException | |
| TlsNotSupported | |
| ResponseBodyTooShort Word64 Word64 | Expected size/actual size. Since 1.9.4 |
| InvalidChunkHeaders | Since 1.9.4 |
| IncompleteHeaders |
Constructors
Define a HTTP proxy, consisting of a hostname and port number.
Constructors
| Proxy | |
Fields
| |
data RequestBody Source
When using one of the
RequestBodySource / RequestBodySourceChunked constructors,
you must ensure
that the Source can be called multiple times. Usually this
is not a problem.
The RequestBodySourceChunked will send a chunked request
body, note that not all servers support this. Only use
RequestBodySourceChunked if you know the server you're
sending to supports chunked request bodies.
Constructors
| RequestBodyLBS !ByteString | |
| RequestBodyBS !ByteString | |
| RequestBodyBuilder !Int64 !Builder | |
| RequestBodyStream !Int64 !(GivesPopper ()) | |
| RequestBodyStreamChunked !(GivesPopper ()) |
Instances
simplify :: RequestBody -> Either (Int64, Builder) (Maybe Int64, GivesPopper ())Source
builderToStream :: (Int64, Builder) -> (Maybe Int64, GivesPopper ())Source
type Popper = IO ByteStringSource
type NeedsPopper a = Popper -> IO aSource
type GivesPopper a = NeedsPopper a -> IO aSource
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-conduit 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.
Constructors
| Request | |
Fields
| |
type ContentType = ByteStringSource
type ConnRelease = ConnReuse -> IO ()Source
data ManagedConn Source
A simple representation of the HTTP response created by lbsConsumer.
Constructors
| Response | |
Fields
| |
responseClose :: Response a -> IO ()Source