The HTTP package supports client-side web programming in Haskell. It lets you set up HTTP connections, transmitting requests and processing the responses coming back, all from within the comforts of Haskell. It's dependent on the network package to operate, but other than that, the implementation is all written in Haskell.
A basic API for issuing single HTTP requests + receiving responses is provided. On top of that, a session-level abstraction is also on offer (the BrowserAction monad); it taking care of handling the management of persistent connections, proxies, state (cookies) and authentication credentials required to handle multi-step interactions with a web server.
The representation of the bytes flowing across is extensible via the use of a type class, letting you pick the representation of requests and responses that best fits your use. Some pre-packaged, common instances are provided for you (ByteString, String.)
Here's an example use:
> rsp <- Network.HTTP.simpleHTTP (getRequest "http://www.haskell.org/")
> -- fetch document and return it (as a 'String'.)
> fmap (take 100) (getResponseBody rsp)
> (_, rsp)
> <- Network.Browser.browse $ do
> setAllowRedirects True -- handle HTTP redirects
> request $ getRequest "http://www.haskell.org/"
> return (take 100 (rspBody rsp))
The HTTP module provides a simple interface for sending and receiving content over HTTP in Haskell. Here's how to fetch a document from a URL and return it as a String:
> simpleHTTP (getRequest "http://www.haskell.org/") >>= fmap (take 100) . getResponseBody
> -- fetch document and return it (as a 'String'.)
Other functions let you control the submission and transfer of HTTP Requests and Responses more carefully, letting you integrate the use of HTTP functionality into your application.
The module also exports the main types of the package, Request and Response, along with Header and functions for working with these.
The actual functionality is implemented by modules in the Network.HTTP.* namespace, letting you either use the default implementation here by importing Network.HTTP or, for more specific uses, selectively import the modules in Network.HTTP.*. To wit, more than one kind of representation of the bulk data that flows across a HTTP connection is supported. (see Network.HTTP.HandleStream.)
NOTE: The Request send actions will normalize the Request prior to transmission. Normalization such as having the request path be in the expected form and, possibly, introduce a default Host: header if one isn't already present. If you do not want the requests tampered with, but sent as-is, please import and use the the Network.HTTP.HandleStream or Network.HTTP.Stream modules instead. They export the same functions, but leaves construction and any normalization of Requests to the user.
NOTE: This package only supports HTTP; it does not support HTTPS. Attempts to use HTTPS result in an error.
DEPRECATED Enable simple wrappers to Network.HTTP
Functions for working with HTTP Accept headers. You may also want check out parseHttpAccept from wai-extra:Network.Wai.Parse (it is not tied to WAI in any way and some similar may make it into this package eventually).
Attoparsec parsers for http-types.
Multiple challenges aren't implemented. Authentication-Info header isn't either.
This package creates a monad representing things that browsers do, letting you elegantly describe a browsing session. This package wraps the http-conduit package by Michael Snoyman.
HTTPHTTPS downloader built on top of http-conduit and used in <http:/bazqux.com> crawler.
* Handles all possible http-conduit exceptions and returns human readable error messages.
* Handles some web server bugs (returning deflate data instead of gzip).
* Ignores invalid SSL sertificates.
* Receives data in 32k blocks internally to reduce memory fragmentation on many parallel downloads.
* Download timeout.
* Total download size limit.
* Returns HTTP headers for subsequent redownloads and handles 'Not modified' results.
* Can be used with external DNS resolver (hsdns-cache for example).
Fast parser and formatter for HTTP Date
This package has been deprecated in favor of http-conduit (http://hackage.haskell.org/package/http-conduit), which provides a more powerful and simpler interface. The API is very similar, and migrating should not be problematic. Send concerns about this move to the maintainer (address listed above).
This library implements a monad class with various interesting instances:
* Lazy I/O allows for fetching documents via HTTP on demand
* Non-I/O allows for testing HTTP communication without any IO action
By using this monad you can implement HTTP communication in a very general way. You may add further functionality by adding custom sub-classes.
We inherit all content data types from the HTTP-4000 package, such as String as well as strict and lazy ByteString.
http-proxy is a library for writing HTTP and HTTPS proxies.
Use of the Conduit library provides file streaming via the proxy in both directions. Memory usage of the proxy scales linearly with the number of simultaneous connections and is independent of the size of the files being uploaded or downloaded.
The Settings data type provided by the library allows the caller to supply a functions for exception reporting and request re-writing. Eventually, this capability will be expanded to allow optional logging, disk caching etc.
Provides a simple means of reverse-proxying HTTP requests. The raw approach uses the same technique as leveraged by keter, whereas the WAI approach performs full request/response parsing via WAI and http-conduit.
A library for writing Haskell web servers.
This web server promotes a Request to IO Response function into a local web server. The user can decide how to interpret the requests, and the library is intended for implementing Ajax APIs.
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.
Generic HTTP types for Haskell (for both client and server code).
Show more results