The http-streams package

[Tags:bsd3, library, test]


An HTTP client, using the Snap Framework's io-streams library to hande the streaming IO. The API is optimized for ease of use for the rather common case of code needing to query web services and deal with the result.

The library is exported in a single module; see Network.Http.Client for full documentation.

[Skip to Readme]


Versions,,,,,,,,,,,,,,,,,,,,,,,,,, (info)
Change log CHANGELOG.markdown
Dependencies aeson, attoparsec, base (==4.*), base64-bytestring, blaze-builder (>=0.4), bytestring, case-insensitive, directory, HsOpenSSL (>=0.11.2), http-common (>=0.8.2), io-streams (>=1.3 && <1.5), mtl, network, network-uri, openssl-streams (>=1.1 && <1.4), text, transformers, unordered-containers [details]
License BSD3
Copyright © 2012-2017 Operational Dynamics Consulting, Pty Ltd and Others
Author Andrew Cowie <>
Maintainer Andrew Cowie <>
Category Web, IO-Streams
Home page
Bug tracker
Source repository head: git clone git://
Uploaded Fri May 12 11:51:18 UTC 2017 by AndrewCowie
Updated Tue May 16 08:23:20 UTC 2017 by HerbertValerioRiedel to revision 1
Distributions Debian:, LTSHaskell:, NixOS:, Stackage:, Tumbleweed:
Downloads 8894 total (93 in the last 30 days)
1 []
Status Docs available [build log]
Last success reported on 2017-05-12 [all 1 reports]
Hackage Matrix CI




network-uriGet Network.URI from the network-uri packageEnabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees

Readme for http-streams

Readme for http-streams-

An HTTP client

An HTTP client library for Haskell using the Snap Framework's io-streams library to handle the streaming IO. <!-- replace with link to hackage when it is released -->

A common case in writing RESTful web services is needing to make onward calls to further servers. This package is intended to make this easy to do. Though originally written for making calls from wep apps written with Snap, you can use this from any library or framework.



The underlying API is very simple:

main :: IO ()
main = do
    c <- openConnection "" 80
    let q = buildRequest1 $ do
                http GET "/"
                setAccept "text/html"
    sendRequest c q emptyBody
    receiveResponse c (\p i -> do
        putStr $ show p

        x <- i
        S.putStr $ fromMaybe "" x)
    closeConnection c

There are also convenience functions for the common case of making straight-forward GET and POST requests; for instance:

    get "" (\_ i -> Streams.connect i stdout)

will {ahem} stream the response body to stdout. Perhaps more interesting (though less streams-oriented), is simply getting the response as a ByteString using one of the pre-defined handlers:

    x' <- get "" concatHandler

See the documentation in Network.Http.Client for further examples and details of usage of the API. There's also a blog post introducing the library with a discussion of the design and usage.

Change Log

Now included in separate file CHANGELOG.