Safe Haskell | None |
---|---|
Language | Haskell98 |
A new, experimental API to replace Network.HTTP.Conduit.
For most users, Network.HTTP.Simple is probably a better choice. For more information, see:
https://haskell-lang.org/library/http-client
For more information on using this module, please be sure to read the documentation in the Network.HTTP.Client module.
- withResponse :: (MonadUnliftIO m, MonadIO n, MonadReader env m, HasHttpManager env) => Request -> (Response (ConduitM i ByteString n ()) -> m a) -> m a
- responseOpen :: (MonadIO m, MonadIO n, MonadReader env m, HasHttpManager env) => Request -> m (Response (ConduitM i ByteString n ()))
- responseClose :: MonadIO m => Response body -> m ()
- acquireResponse :: (MonadIO n, MonadReader env m, HasHttpManager env) => Request -> m (Acquire (Response (ConduitM i ByteString n ())))
- defaultManagerSettings :: ManagerSettings
- newManager :: MonadIO m => m Manager
- newManagerSettings :: MonadIO m => ManagerSettings -> m Manager
- module Network.HTTP.Client
- httpLbs :: (MonadIO m, HasHttpManager env, MonadReader env m) => Request -> m (Response ByteString)
- httpNoBody :: (MonadIO m, HasHttpManager env, MonadReader env m) => Request -> m (Response ())
- requestBodySource :: Int64 -> ConduitM () ByteString IO () -> RequestBody
- requestBodySourceChunked :: ConduitM () ByteString IO () -> RequestBody
- bodyReaderSource :: MonadIO m => BodyReader -> ConduitM i ByteString m ()
Conduit-specific interface
withResponse :: (MonadUnliftIO m, MonadIO n, MonadReader env m, HasHttpManager env) => Request -> (Response (ConduitM i ByteString n ()) -> m a) -> m a Source #
Conduit powered version of withResponse
. Differences are:
- Response body is represented as a
Producer
. - Generalized to any instance of
MonadUnliftIO
, not justIO
. - The
Manager
is contained by aMonadReader
context.
Since 2.1.0
responseOpen :: (MonadIO m, MonadIO n, MonadReader env m, HasHttpManager env) => Request -> m (Response (ConduitM i ByteString n ())) Source #
Conduit-powered version of responseOpen
.
See withResponse
for the differences with responseOpen
.
Since 2.1.0
responseClose :: MonadIO m => Response body -> m () Source #
Generalized version of responseClose
.
Since 2.1.0
acquireResponse :: (MonadIO n, MonadReader env m, HasHttpManager env) => Request -> m (Acquire (Response (ConduitM i ByteString n ()))) Source #
An Acquire
for getting a Response
.
Since 2.1.0
Manager helpers
defaultManagerSettings :: ManagerSettings Source #
TLS-powered manager settings.
Since 2.1.0
newManager :: MonadIO m => m Manager Source #
Get a new manager using defaultManagerSettings
.
Since 2.1.0
newManagerSettings :: MonadIO m => ManagerSettings -> m Manager Source #
Get a new manager using the given settings.
Since 2.1.0
General HTTP client interface
module Network.HTTP.Client
httpLbs :: (MonadIO m, HasHttpManager env, MonadReader env m) => Request -> m (Response ByteString) Source #
Same as httpLbs
, except it uses the Manager
in the reader environment.
Since 2.1.1
httpNoBody :: (MonadIO m, HasHttpManager env, MonadReader env m) => Request -> m (Response ()) Source #
Same as httpNoBody
, except it uses the Manager
in the reader environment.
This can be more convenient that using withManager
as it avoids the need
to specify the base monad for the response body.
Since 2.1.2
Lower-level conduit functions
requestBodySource :: Int64 -> ConduitM () ByteString IO () -> RequestBody Source #
requestBodySourceChunked :: ConduitM () ByteString IO () -> RequestBody Source #
bodyReaderSource :: MonadIO m => BodyReader -> ConduitM i ByteString m () Source #