http-conduit-2.1.0: HTTP client package with conduit interface and HTTPS support.

Safe HaskellNone

Network.HTTP.Client.Conduit

Contents

Description

A new, experimental API to replace Network.HTTP.Conduit.

Synopsis

Conduit-specific interface

withResponse :: (MonadBaseControl IO m, MonadIO n, MonadReader env m, HasHttpManager env) => Request -> (Response (ConduitM i ByteString n ()) -> m a) -> m aSource

Conduit powered version of withResponse. Differences are:

  • Response body is represented as a Producer.
  • Generalized to any instance of MonadBaseControl, not just IO.
  • The Manager is contained by a MonadReader 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 :: ManagerSettingsSource

TLS-powered manager settings.

Since 2.1.0

newManager :: MonadIO m => m ManagerSource

Get a new manager using defaultManagerSettings.

Since 2.1.0

withManager :: MonadIO m => ReaderT Manager m a -> m aSource

Get a new manager with defaultManagerSettings and construct a ReaderT containing it.

Since 2.1.0

withManagerSettings :: MonadIO m => ManagerSettings -> ReaderT Manager m a -> m aSource

Get a new manager with the given settings and construct a ReaderT containing it.

Since 2.1.0

newManagerSettings :: MonadIO m => ManagerSettings -> m ManagerSource

Get a new manager using the given settings.

Since 2.1.0

General HTTP client interface

Lower-level conduit functions