Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
scripts
src/System/IO/Streams
test
.gitignore
.travis.yml
LICENSE
Main.hs
README.md
Setup.lhs
io-streams-http.cabal

README.md

io-streams-http Build Status Hackage

http-client-tls meets io-streams

http-client usage

module Main where

import           System.IO.Streams (InputStream, OutputStream)
import qualified System.IO.Streams as Streams
import           System.IO.Streams.HTTP

import           Network.HTTP.Client

main :: IO ()
main = do
  req <- parseUrl "http://google.com"
    withManager defaultManagerSettings $ \m ->
        withHTTP req m $ \resp -> do
                Streams.supplyTo Streams.stdout (responseBody resp)  

http-client-tls usage

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 "http://google.com"
    withManager tlsManagerSettings $ \m ->
        withHTTP req m $ \resp -> do
                Streams.supplyTo Streams.stdout (responseBody resp)