| Safe Haskell | None |
|---|
Network.HTTP.Toolkit.Response
- type ResponseHeader = MessageHeader Status
- readResponse :: Method -> Connection -> IO (ResponseHeader, BodyReader)
- readResponseWithLimit :: Limit -> Method -> Connection -> IO (ResponseHeader, BodyReader)
- parseStatusLine :: ByteString -> Maybe Status
- determineResponseBodyType :: Method -> Status -> [Header] -> BodyType
Documentation
readResponse :: Method -> Connection -> IO (ResponseHeader, BodyReader)Source
Same as readResponseWithLimit with a Limit of
defaultHeaderSizeLimit.
readResponseWithLimit :: Limit -> Method -> Connection -> IO (ResponseHeader, BodyReader)Source
Read response from provided connection.
Throws:
-
InvalidStatusLineif request-line is malformed. -
HeaderTooLargeif the header size exceeds the specifiedLimit. -
InvalidHeaderif header is malformed.
parseStatusLine :: ByteString -> Maybe StatusSource
Parse status-line (see RFC 2616, Section 6.1).
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).