-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | HTTP client with pipes interface
--   
--   <tt>pipes-http</tt> is a <tt>pipes</tt> wrapper around the
--   <tt>http-client</tt> library
@package pipes-http
@version 1.0.5


-- | Here is an example GET request that streams the response body to
--   standard output:
--   
--   <pre>
--   import Pipes
--   import Pipes.HTTP
--   import qualified Pipes.ByteString as PB  -- from `pipes-bytestring`
--   
--   main = do
--       req &lt;- parseUrl "https://www.example.com"
--       withManager tlsManagerSettings $ \m -&gt;
--           withHTTP req m $ \resp -&gt;
--               runEffect $ responseBody resp &gt;-&gt; PB.stdout
--   </pre>
--   
--   Here is an example POST request that also streams the request body
--   from standard input:
--   
--   <pre>
--   {-# LANGUAGE OverloadedStrings #-}
--   
--   import Pipes
--   import Pipes.HTTP
--   import qualified Pipes.ByteString as PB
--   
--   main = do
--       req &lt;- parseUrl "https://www.example.com"
--       let req' = req
--               { method = "POST"
--               , requestBody = stream PB.stdin
--               }
--       withManager tlsManagerSettings $ \m -&gt;
--           withHTTP req' m $ \resp -&gt;
--               runEffect $ responseBody resp &gt;-&gt; PB.stdout
--   </pre>
--   
--   For non-streaming request bodies, study the <a>RequestBody</a> type,
--   which also accepts strict / lazy bytestrings or builders.
module Pipes.HTTP

-- | Send an HTTP <a>Request</a> and wait for an HTTP <a>Response</a>
withHTTP :: Request -> Manager -> (Response (Producer ByteString IO ()) -> IO a) -> IO a

-- | Create a <a>RequestBody</a> from a content length and <a>Producer</a>
streamN :: Int64 -> Producer ByteString IO () -> RequestBody

-- | Create a <a>RequestBody</a> from a <a>Producer</a>
--   
--   <a>stream</a> is more flexible than <a>streamN</a>, but requires the
--   server to support chunked transfer encoding.
stream :: Producer ByteString IO () -> RequestBody
