HTTP-4000.2.17: A library for client-side HTTP

Portability | non-portable (not tested)
Stability | experimental
Maintainer | Ganesh Sittampalam <ganesh@earth.li>
Safe Haskell | None

Network.HTTP.Stream

Description

Transmitting HTTP requests and responses holding `String` in their payload bodies. This is one of the implementation modules for the Network.HTTP interface, representing request and response content as `String`s and transmitting them in non-packed form (cf. Network.HTTP.HandleStream and its use of `ByteString`s.) over `Stream` handles. It is mostly here for backwards compatibility, representing how requests and responses were transmitted up until the 4.x releases of the HTTP package.

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.

Synopsis

- module Network.Stream
- simpleHTTP :: Request_String -> IO (Result Response_String)
- simpleHTTP_ :: Stream s => s -> Request_String -> IO (Result Response_String)
- sendHTTP :: Stream s => s -> Request_String -> IO (Result Response_String)
- sendHTTP_notify :: Stream s => s -> Request_String -> IO () -> IO (Result Response_String)
- receiveHTTP :: Stream s => s -> IO (Result Request_String)
- respondHTTP :: Stream s => s -> Response_String -> IO ()

# Documentation

module Network.Stream

simpleHTTP :: Request_String -> IO (Result Response_String)

Simple way to transmit a resource across a non-persistent connection.

simpleHTTP_ :: Stream s => s -> Request_String -> IO (Result Response_String)

Like `simpleHTTP`, but acting on an already opened stream.

sendHTTP :: Stream s => s -> Request_String -> IO (Result Response_String)

sendHTTP_notify :: Stream s => s -> Request_String -> IO () -> IO (Result Response_String)

receiveHTTP :: Stream s => s -> IO (Result Request_String)

Receive and parse a HTTP request from the given Stream. Should be used for server side interactions.

respondHTTP :: Stream s => s -> Response_String -> IO ()

Very simple function, send a HTTP response over the given stream. This could be improved on to use different transfer types.