HTTP +Network +http

module Network.HTTP
HTTP Network.HTTP
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.
type HTTPRequest a = Request a
HTTP Network.HTTP.Base
type HTTPResponse a = Response a
HTTP Network.HTTP.Base
httpPackageVersion :: String
HTTP Network.HTTP.Base
The version of this HTTP package as a string, e.g. "4000.1.2". This may be useful to include in a user agent string so that you can determine from server logs what version of this package HTTP clients are using. This can be useful for tracking down HTTP compatibility quirks.
httpVersion :: String
HTTP Network.HTTP.Base
failHTTPS :: Monad m => URI -> m ()
HTTP Network.HTTP.Base
receiveHTTP :: HStream bufTy => HandleStream bufTy -> IO (Result (Request bufTy))
HTTP Network.HTTP.HandleStream
receiveHTTP hStream reads a Request from the HandleStream hStream
receiveHTTP :: HStream ty => HandleStream ty -> IO (Result (Request ty))
HTTP Network.HTTP
receiveHTTP hStream reads a Request from the HandleStream hStream
receiveHTTP :: Stream s => s -> IO (Result Request_String)
HTTP Network.HTTP.Stream
Receive and parse a HTTP request from the given Stream. Should be used for server side interactions.
respondHTTP :: HStream ty => HandleStream ty -> Response ty -> IO ()
HTTP Network.HTTP.HandleStream, HTTP Network.HTTP
respondHTTP hStream httpResponse transmits an HTTP Response over the HandleStream hStream. It could be used to implement simple web server interactions, performing the dual role to sendHTTP.
respondHTTP :: Stream s => s -> Response_String -> IO ()
HTTP Network.HTTP.Stream
Very simple function, send a HTTP response over the given stream. This could be improved on to use different transfer types.
sendHTTP :: HStream ty => HandleStream ty -> Request ty -> IO (Result (Response ty))
HTTP Network.HTTP
sendHTTP hStream httpRequest transmits httpRequest (after normalization) over hStream, but does not alter the status of the connection, nor request it to be closed upon receiving the response.
sendHTTP :: HStream ty => HandleStream ty -> Request ty -> IO (Result (Response ty))
HTTP Network.HTTP.HandleStream
sendHTTP hStream httpRequest transmits httpRequest over hStream, but does not alter the status of the connection, nor request it to be closed upon receiving the response.
sendHTTP :: Stream s => s -> Request_String -> IO (Result Response_String)
HTTP Network.HTTP.Stream
sendHTTP_notify :: HStream ty => HandleStream ty -> Request ty -> IO () -> IO (Result (Response ty))
HTTP Network.HTTP.HandleStream, HTTP Network.HTTP
sendHTTP_notify hStream httpRequest action behaves like sendHTTP, but lets you supply an IO action to execute once the request has been successfully transmitted over the connection. Useful when you want to set up tracing of request transmission and its performance.
sendHTTP_notify :: Stream s => s -> Request_String -> IO () -> IO (Result Response_String)
HTTP Network.HTTP.Stream
simpleHTTP :: Request_String -> IO (Result Response_String)
HTTP Network.HTTP.Stream
Simple way to transmit a resource across a non-persistent connection.
simpleHTTP :: HStream ty => Request ty -> IO (Result (Response ty))
HTTP Network.HTTP
simpleHTTP req transmits the Request req by opening a direct, non-persistent connection to the HTTP server that req is destined for, followed by transmitting it and gathering up the response as a Result. Prior to sending the request, it is normalized (via normalizeRequest). If you have to mediate the request via an HTTP proxy, you will have to normalize the request yourself. Or switch to using Browser instead. Examples: > simpleHTTP (getRequest "http://hackage.haskell.org/") > simpleHTTP (getRequest "http://hackage.haskell.org:8012/")
simpleHTTP :: HStream ty => Request ty -> IO (Result (Response ty))
HTTP Network.HTTP.HandleStream
simpleHTTP transmits a resource across a non-persistent connection.
simpleHTTP_ :: HStream ty => HandleStream ty -> Request ty -> IO (Result (Response ty))
HTTP Network.HTTP
Identical to simpleHTTP, but acting on an already opened stream.

Show more results