Http is:package
A library for client-side HTTP
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:
do
rsp <- Network.HTTP.simpleHTTP (getRequest "http://www.haskell.org/")
-- fetch document and return it (as a 'String'.)
fmap (take 100) (getResponseBody rsp)
do
(_, rsp)
<- Network.Browser.browse $ do
setAllowRedirects True -- handle HTTP redirects
request $ getRequest "http://www.haskell.org/"
return (take 100 (rspBody rsp))
Note: This package does not support HTTPS connections. If you
need HTTPS, take a look at the following packages:
Not on Stackage, so not searched.
DEPRECATED Enable simple wrappers to Network.HTTP
Generic HTTP types for Haskell (for both client and server code).
Types and functions to describe and handle HTTP concepts. Including
"methods", "headers", "query strings", "paths" and "HTTP versions".
Converting to/from HTTP API data like URL pieces, headers and query parameters.
This package defines typeclasses used for converting Haskell data
types to and from HTTP API data.
Please see README.md
Processing HTTP Content-Type and Accept headers
This library is intended to be a comprehensive solution to parsing and
selecting quality-indexed values in HTTP headers. It is capable of
parsing both media types and language parameters from the Accept and
Content header families, and can be extended to match against other
accept headers as well. Selecting the appropriate header value is
achieved by comparing a list of server options against the
quality-indexed values supplied by the client.
In the following example, the Accept header is parsed and then matched
against a list of server options to serve the appropriate media using
mapAcceptMedia:
getHeader >>= maybe send406Error sendResourceWith . mapAcceptMedia
[ ("text/html", asHtml)
, ("application/json", asJson)
]
Similarly, the Content-Type header can be used to produce a parser for
request bodies based on the given content type with
mapContentMedia:
getContentType >>= maybe send415Error readRequestBodyWith . mapContentMedia
[ ("application/json", parseJson)
, ("text/plain", parseText)
]
The API is agnostic to your choice of server.
An HTTP client using io-streams
An HTTP client, using the Snap Framework's 'io-streams' library to
handle 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.
HTTP/2 library
HTTP/2 library including frames, priority queues, HPACK, client and
server.
HTTP Date parser/formatter
Fast parser and formatter for HTTP Date
Not on Stackage, so not searched.
A native HTTP2 client library.
Not on Stackage, so not searched.
Types for gRPC over HTTP2 common for client and servers.
http directory listing library
Library for listing the files (href's) in an http directory. It can
also check the size, existence, modtime of files, and url redirects.
Not on Stackage, so not searched.
HTTP client package with enumerator interface and HTTPS support. (deprecated)
Simple http queries
Simple web API queries returning JSON.
Reverse proxy HTTP requests, either over raw sockets or with WAI
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.
Not on Stackage, so not searched.
Implement gRPC-over-HTTP2 clients.
HTTP Link header parser/writer
Library for the HTTP Link header as specified in RFC 5988 "Web
Linking"
Not on Stackage, so not searched.
Encoders based on `proto-lens` for gRPC over HTTP2.
Common types for HTTP clients and servers
Overview
Base types used by a variety of HTTP clients and servers. See
http-streams
Network.Http.Client or pipes-http
Pipes.Http.Client for full documentation. You can import
Network.Http.Types if you like, but both http-streams and
pipes-http re-export this package's types and functions.
A simple web-server with an interact style API
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.
Not on Stackage, so not searched.
HTTP/3 library
Verified downloads with retries
Higher level HTTP download APIs include verification of content and
retries