ihttp-0.1.0: Incremental HTTP iteratee

MaintainerErtugrul Soeylemez <es@ertes.de>




Iteratees for header parsing.



httpHeader :: forall m. Monad m => Int -> Iteratee ByteString m (Maybe (ByteString, ByteString))Source

Get the next header from the netLinesEmpty-splitted stream. The header's content is length-limited by the given argument. If it's longer, it's safely truncated in constant space. This iteratee throws an iteratee error, if the next lines are not a valid HTTP header or the stream ends prematurely. If the next line is an empty line, this iteratee returns Nothing.

httpHeaders :: forall m. Monad m => Int -> Int -> Iteratee ByteString m HeaderMapSource

Get the headers of an HTTP request from a netLinesEmpty-splitted byte stream. The first Int specifies the maximum length of individual headers. The second Int specifies the maximum number of headers. This iteratee throws an iteratee error on invalid input, of if the stream ends prematurely.

Excess data is truncated safely in constant space.