Stability | beta |
---|---|
Maintainer | Ertugrul Soeylemez <es@ertes.de> |
Iteratees for requests.
- request :: Monad m => Int -> Int -> Iteratee ByteString m Request
- requestLine :: Monad m => Iteratee ByteString m Request
- enumRequest :: forall b m. Monad m => Request -> Enumerator ByteString m b
- enumRequestLine :: forall b m. Monad m => HttpMethod -> ByteString -> HttpVersion -> Enumerator ByteString m b
- mkGetRequest :: ByteString -> ByteString -> Request
Iteratees
request :: Monad m => Int -> Int -> Iteratee ByteString m RequestSource
Get the next full request from a netLinesEmpty
-splitted byte
stream. If the request 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.
requestLine :: Monad m => Iteratee ByteString m RequestSource
Get the next request line from a netLinesEmpty
-splitted byte
stream. If the request is invalid or the stream ends prematurely an
iteratee error is thrown.
Enumerators
enumRequest :: forall b m. Monad m => Request -> Enumerator ByteString m bSource
Enumerate a complete request as a protocol string stream. You can
use Data.Enumerator.Binary.iterHandle
to send it.
enumRequestLine :: forall b m. Monad m => HttpMethod -> ByteString -> HttpVersion -> Enumerator ByteString m bSource
Enumerate a request line with the given method, URI and HTTP
version as a protocol string stream. You can use
Data.Enumerator.Binary.iterHandle
to send it.
Helper functions
mkGetRequest :: ByteString -> ByteString -> RequestSource
Construct a HTTP 1.1 GET request with the given domain (first argument) and URI (second argument).