The http-streams package

[Tags: bsd3, library]


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]


Versions0.3.1.0,,,,,,,,,,,,,,,,,,,,,,, (info)
Change logCHANGELOG.markdown
Dependenciesaeson, attoparsec, base (==4.*), base64-bytestring, blaze-builder (>=0.4), bytestring, case-insensitive, directory, HsOpenSSL (>=, http-common (>=0.8.2), io-streams (==1.3.*), mtl, network, network-uri, openssl-streams (>=1.1 && <1.4), text, transformers, unordered-containers [details]
Copyright© 2012-2015 Operational Dynamics Consulting, Pty Ltd and Others
AuthorAndrew Cowie <>
MaintainerAndrew Cowie <>
CategoryWeb, IO-Streams
Home page
Bug tracker
Source repositoryhead: git clone git://
UploadedFri Jun 12 05:14:15 UTC 2015 by AndrewCowie
DistributionsDebian:, LTSHaskell:, NixOS:, Stackage:
Downloads6772 total (257 in last 30 days)
1 []
StatusDocs available [build log]
Last success reported on 2015-06-12 [all 1 reports]




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


Maintainers' corner

For package maintainers and hackage trustees

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.