HTTP-4000.2.8: A library for client-side HTTP

Portabilitynon-portable (not tested)
MaintainerGanesh Sittampalam <>
Safe HaskellNone



A HandleStream-based version of Network.HTTP interface.

For more detailed information about what the individual exports do, please consult the documentation for Network.HTTP. Notice however that the functions here do not perform any kind of normalization prior to transmission (or receipt); you are responsible for doing any such yourself, or, if you prefer, just switch to using Network.HTTP function instead.



simpleHTTP :: HStream ty => Request ty -> IO (Result (Response ty))Source

simpleHTTP transmits a resource across a non-persistent connection.

simpleHTTP_ :: HStream ty => HandleStream ty -> Request ty -> IO (Result (Response ty))Source

Like simpleHTTP, but acting on an already opened stream.

sendHTTP :: HStream ty => HandleStream ty -> Request ty -> IO (Result (Response ty))Source

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_notify :: HStream ty => HandleStream ty -> Request ty -> IO () -> IO (Result (Response ty))Source

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.

receiveHTTP :: HStream bufTy => HandleStream bufTy -> IO (Result (Request bufTy))Source

receiveHTTP hStream reads a Request from the HandleStream hStream

respondHTTP :: HStream ty => HandleStream ty -> Response ty -> IO ()Source

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.

simpleHTTP_debug :: HStream ty => FilePath -> Request ty -> IO (Result (Response ty))Source

simpleHTTP_debug debugFile req behaves like simpleHTTP, but logs the HTTP operation via the debug file debugFile.