io-streams-http 0.1.0.0 → 0.1.0.1
raw patch · 2 files changed
+13/−15 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- io-streams-http.cabal +1/−1
- src/System/IO/Streams/HTTP.hs +12/−14
io-streams-http.cabal view
@@ -1,5 +1,5 @@ name: io-streams-http-version: 0.1.0.0+version: 0.1.0.1 synopsis: http-client for io-streams description: Thin io-streams wrapper for http-client license: BSD3
src/System/IO/Streams/HTTP.hs view
@@ -20,22 +20,20 @@ -- -- > {-# LANGUAGE OverloadedStrings #-} -- >--- > import System.IO.Streams (InputStream, OutputStream)--- > import qualified System.IO.Streams as Streams--- > import System.IO.Streams.HTTP--- > import Network.HTTP.Client--- >+-- > module Main where+-- > import System.IO.Streams ( InputStream, OutputStream )+-- > import qualified System.IO.Streams as Streams+-- > import System.IO.Streams.HTTP ( withHTTP, parseUrl, withManager )+-- > import Network.HTTP.Client.TLS ( tlsManagerSettings )+-- > import Network.HTTP.Client ( responseBody )+-- > -- > main :: IO () -- > main = do--- > req <- parseUrl "https://www.example.com"--- > is <- handleFromInputStream stdin--- > let req' = req--- > { method = "POST"--- > , requestBody = stream is--- > }--- > withManager tlsManagerSettings $ \m ->--- > Streams.handleToOutputStream stdout >>=--- > Streams.connect (responseBody resp)+-- > req <- parseUrl "http://www.worldslongestwebsite.com"+-- > withManager tlsManagerSettings $ \m ->+-- > withHTTP req m $ \resp -> do+-- > Streams.supplyTo Streams.stdout (responseBody resp)+-- > -- -- For non-streaming request bodies, study the 'RequestBody' type, -- which also