ihttp-0.2.0: Incremental HTTP iteratee

Stabilitybeta
MaintainerErtugrul Soeylemez <es@ertes.de>

Network.IHttp.Response

Contents

Description

Iteratees for response.

Synopsis

Iteratees

response :: Monad m => Int -> Int -> Iteratee ByteString m ResponseSource

Get the next full response from a netLinesEmpty-splitted byte stream. If the response is invalid or the stream ends prematurely an iteratee error is thrown. The first Int specifies the maximum header content length. The second Int specifies the maximum number of headers. Excess data is truncated safely in constant space.

responseLine :: Monad m => Iteratee ByteString m ResponseSource

Get the next response line form netLinesEmpty-splitted stream. If the response line is invalid or the stream ended prematurely, then an iteratee error is thrown.

Enumerators

enumResponse :: forall b m. Monad m => Response -> Enumerator ByteString m bSource

Enumerate a complete response as a protocol string stream. You can use Data.Enumerator.Binary.iterHandle to send it.

enumResponseLine :: forall b m. Monad m => HttpVersion -> Int -> ByteString -> Enumerator ByteString m bSource

Enumerate a response line with the given HTTP version, response code and message as a protocol string stream. You can use Data.Enumerator.Binary.iterHandle to send it.