http-io-streams 0.1.1.0 → 0.1.2.0
raw patch · 4 files changed
+40/−2 lines, 4 filesdep ~base64-bytestringPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base64-bytestring
API changes (from Hackage documentation)
+ Network.Http.Client: unsafeReceiveResponse :: Connection -> (Response -> InputStream ByteString -> IO β) -> IO β
+ Network.Http.Client: unsafeReceiveResponseRaw :: Connection -> (Response -> InputStream ByteString -> IO β) -> IO β
Files
- CHANGELOG.md +4/−0
- http-io-streams.cabal +3/−2
- http-streams/lib/Network/Http/Client.hs +2/−0
- http-streams/lib/Network/Http/Connection.hs +31/−0
CHANGELOG.md view
@@ -1,3 +1,7 @@+### 0.1.2.0++* New functions `unsafeReceiveResponse` and `unsafeReceiveResponseRaw` that do not automatically skip to end-of-stream+ ### 0.1.1.0 * New alternative connection-setup API (`ConnectionAddress` et al.)
http-io-streams.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: http-io-streams-version: 0.1.1.0+version: 0.1.2.0 synopsis: HTTP client based on io-streams description:@@ -19,7 +19,8 @@ license: BSD-3-Clause license-file: LICENCE-author: Andrew Cowie <andrew@operationaldynamics.com>+author: Andrew Cowie <andrew@operationaldynamics.com>,+ Herbert Valerio Riedel <hvr@gnu.org> maintainer: Herbert Valerio Riedel <hvr@gnu.org> copyright: © 2012-2018 Operational Dynamics Consulting, Pty Ltd and Others category: Web, IO-Streams
http-streams/lib/Network/Http/Client.hs view
@@ -132,6 +132,8 @@ -- * Processing HTTP response receiveResponse, receiveResponseRaw,+ unsafeReceiveResponse,+ unsafeReceiveResponseRaw, UnexpectedCompression, StatusCode, getStatusCode,
http-streams/lib/Network/Http/Connection.hs view
@@ -29,6 +29,8 @@ sendRequest, receiveResponse, receiveResponseRaw,+ unsafeReceiveResponse,+ unsafeReceiveResponseRaw, UnexpectedCompression, emptyBody, fileBody,@@ -491,6 +493,35 @@ where i = cIn c +--+-- | Handle the response coming back from the server. This function+-- is the same as receiveResponse, but it does not consume the body for+-- you after the handler is done. This means that it can only be safely used+-- if the handler will fully consume the body, there is no body, or when+-- the connection is not being reused (no pipelining).+--+-- @since 0.1.2.0+unsafeReceiveResponse :: Connection -> (Response -> InputStream ByteString -> IO β) -> IO β+unsafeReceiveResponse c handler = do+ p <- readResponseHeader i+ i' <- readResponseBody p i++ handler p i'+ where+ i = cIn c+++-- | Variant of 'unsafeReceiveResponse' in the spirit of 'receiveResponseRaw'+--+-- @since 0.1.2.0+unsafeReceiveResponseRaw :: Connection -> (Response -> InputStream ByteString -> IO β) -> IO β+unsafeReceiveResponseRaw c handler = do+ p <- readResponseHeader i+ i' <- readResponseBody p { pContentEncoding = Identity } i++ handler p i'+ where+ i = cIn c -- -- | Use this for the common case of the HTTP methods that only send