Safe Haskell | None |
---|
- type RequestPath = ByteString
- type RequestHeader = MessageHeader (Method, RequestPath)
- readRequest :: Connection -> IO (RequestHeader, BodyReader)
- readRequestWithLimit :: Limit -> Connection -> IO (RequestHeader, BodyReader)
- parseRequestLine :: ByteString -> Maybe (Method, RequestPath)
- determineRequestBodyType :: [Header] -> BodyType
Documentation
type RequestPath = ByteStringSource
type RequestHeader = MessageHeader (Method, RequestPath)Source
readRequest :: Connection -> IO (RequestHeader, BodyReader)Source
Same as readRequestWithLimit
with a Limit
of defaultHeaderSizeLimit
.
readRequestWithLimit :: Limit -> Connection -> IO (RequestHeader, BodyReader)Source
Read request from provided connection.
Throws:
-
InvalidRequestLine
if request-line is malformed. -
HeaderTooLarge
if the header size exceeds the specifiedLimit
. -
InvalidHeader
if header is malformed.
parseRequestLine :: ByteString -> Maybe (Method, RequestPath)Source
Parse request-line (see RFC 2616, Section 5.1).
determineRequestBodyType :: [Header] -> BodyTypeSource
Determine the message BodyType
from a given list of message headers (as
of RFC 2616, Section 4.4).