http-conduit 2.2.2.1 → 2.2.3
raw patch · 3 files changed
+25/−1 lines, 3 files
Files
- ChangeLog.md +4/−0
- Network/HTTP/Simple.hs +20/−0
- http-conduit.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 2.2.3++* Add `withResponse` to `Network.HTTP.Simple`+ ## 2.2.2.1 * setRequestBodyJSON works with aeson's toEncoding function (>= 0.11)
Network/HTTP/Simple.hs view
@@ -23,6 +23,7 @@ , httpJSONEither , httpSink , httpSource+ , withResponse -- * Types , H.Request , H.Response@@ -197,6 +198,25 @@ httpSource req withRes = do man <- liftIO H.getGlobalManager C.bracketP (H.responseOpen req man) H.responseClose+ (withRes . fmap bodyReaderSource)++-- | Perform an action with the given request. This employes the+-- bracket pattern.+--+-- This is similar to 'httpSource', but does not require+-- 'MonadResource' and allows the result to not contain a 'C.ConduitM'+-- value.+--+-- @since 2.2.3+withResponse :: (MonadIO m, Catch.MonadMask m, MonadIO n)+ => H.Request+ -> (H.Response (C.ConduitM i S.ByteString n ()) -> m a)+ -> m a+withResponse req withRes = do+ man <- liftIO H.getGlobalManager+ Catch.bracket+ (liftIO (H.responseOpen req man))+ (liftIO . H.responseClose) (withRes . fmap bodyReaderSource) -- | Alternate spelling of 'httpLBS'
http-conduit.cabal view
@@ -1,5 +1,5 @@ name: http-conduit-version: 2.2.2.1+version: 2.2.3 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>