http-kit-0.5.1: A low-level HTTP library

Safe HaskellNone

Network.HTTP.Toolkit.Response

Synopsis

Documentation

readResponseWithLimit :: Limit -> Bool -> Method -> InputStream -> IO (Response BodyReader)Source

Read response from provided InputStream.

The second argument is passed to makeChunkedReader.

The corresponding request Method has to be specified so that the body length can be determined (see RFC 2616, Section 4.4).

Throws:

simpleResponse :: (ByteString -> IO ()) -> Status -> [Header] -> ByteString -> IO ()Source

Send a simple HTTP response. The provided ByteString is used as the message body. A suitable Content-Length header is added to the specified list of headers.

Note: The first argument to this function is used to send the data. For space efficiency it may be called multiple times.

sendResponse :: (ByteString -> IO ()) -> Response BodyReader -> IO ()Source

Send an HTTP response.

Note: The first argument to this function is used to send the data. For space efficiency it may be called multiple times.

formatStatusLine :: Status -> ByteStringSource

Format status-line.

determineResponseBodyType :: Method -> Status -> [Header] -> BodyTypeSource

Determine the message BodyType from a given Method, Status, and list of message headers (as of RFC 2616, Section 4.4).