http-client-streams 0.2.0.1 → 0.3.0.0
raw patch · 2 files changed
+42/−17 lines, 2 filesdep +http-client-tlsdep ~HsOpenSSLdep ~bytestringdep ~http-clientPVP ok
version bump matches the API change (PVP)
Dependencies added: http-client-tls
Dependency ranges changed: HsOpenSSL, bytestring, http-client, http-client-openssl, io-streams, mtl, transformers
API changes (from Hackage documentation)
Files
- http-client-streams.cabal +25/−10
- src/System/IO/Streams/HTTP.hs +17/−7
http-client-streams.cabal view
@@ -1,7 +1,6 @@ name: http-client-streams-version: 0.2.0.1+version: 0.3.0.0 synopsis: http-client for io-streams supporting openssl-description: Thin io-streams wrapper for http-client w/ openssl support license: BSD3 license-file: LICENSE author: David Johnson@@ -10,18 +9,34 @@ category: Web, IO-Streams build-type: Simple cabal-version: >=1.10+description:+ .+ Thin io-streams wrapper for http-client w/ openssl support.+ To use the tls package (instead of openssl) compile with the TLS flag+ .+ @ cabal configure -ftls @+ .+ +Flag tls+ Description: Enable usage of the Native Haskell TLS implementation as opposed to OpenSSL+ Default: False+ library exposed-modules: System.IO.Streams.HTTP hs-source-dirs: src- build-depends: HsOpenSSL >= 0.11- , base >=4.7 && <4.8- , bytestring- , http-client- , http-client-openssl- , io-streams- , mtl- , transformers >= 0.4.2.0+ build-depends: base >= 4.7 && < 4.8+ , bytestring >= 0.10 && < 0.11+ , http-client >= 0.4 && < 0.5+ , io-streams >= 1.2 && < 1.3+ , mtl >= 2.2 && < 2.3+ , transformers >= 0.4 && < 0.5+ if flag(tls)+ cpp-options: -DFLAG+ build-depends: http-client-tls >= 0.2 && < 0.3+ else+ build-depends: http-client-openssl >= 0.2 && < 0.3+ , HsOpenSSL >= 0.11 && < 0.12 default-language: Haskell2010 source-repository head
src/System/IO/Streams/HTTP.hs view
@@ -1,5 +1,6 @@+{-# LANGUAGE CPP #-} -- | Here is an example GET request that streams the response body to standard--- output:+-- output with OpenSSL: -- -- > {-# LANGUAGE OverloadedStrings #-} -- > module Main where@@ -18,7 +19,7 @@ -- > ) -- > -- > --------------------------------------------------------------------------------- > -- | OpenSSL test+-- > -- | GET test (openssl) -- > main :: IO () -- > main = withOpenSSL $ do -- > let settings = opensslManagerSettings context@@ -27,8 +28,9 @@ -- > withHTTP req mgr $ \resp -> -- > Streams.supplyTo Streams.stdout (responseBody resp) -- >+-- > -- > --------------------------------------------------------------------------------- > -- | POST test+-- > -- | POST test (tls) -- > post :: IO () -- > post = withOpenSSL $ do -- > let settings = opensslManagerSettings context@@ -40,6 +42,7 @@ -- > withHTTP req mgr $ \resp -> -- > Streams.supplyTo Streams.stdout (responseBody resp) + -- -- For non-streaming request bodies, study the 'RequestBody' type, -- which also@@ -49,9 +52,13 @@ -- * http-client -- $httpclient module Network.HTTP.Client+#ifdef FLAG+ , module Network.HTTP.Client.TLS+#else , module Network.HTTP.Client.OpenSSL , module OpenSSL , module OpenSSL.Session+#endif -- * io-streams Interface , withHTTP , streamN@@ -64,11 +71,13 @@ import qualified Data.ByteString as B import Data.Int ( Int64 ) import Network.HTTP.Client-import Network.HTTP.Client.OpenSSL-+#ifdef FLAG+import Network.HTTP.Client.TLS+#else import OpenSSL import OpenSSL.Session-+import Network.HTTP.Client.OpenSSL+#endif import System.IO ( stdout ) import System.IO.Streams ( InputStream , OutputStream@@ -82,7 +91,8 @@ This module is a thin @io-streams@ wrapper around the @http-client@ and @http-client-openssl@ libraries. - If you'd rather use the `tls` library for encryption please see this package: <https://hackage.haskell.org/package/io-streams-http>+ If you'd rather use the `tls` library for encryption then compile+ with the tls flag (i.e. cabal configure -ftls) Read the documentation in the "Network.HTTP.Client" module of the @http-client@ library to learn about how to: