This module serialises and deserialises HTTP headers. It contains Haskell representations of request and replies and can transform them to, and from, the HTTP wire format.
- data Request = Request {
- reqMethod :: Method
- reqUrl :: RelativeURL
- reqMajor :: Int
- reqMinor :: Int
- reqHeaders :: Headers
- data Reply = Reply {
- replyMajor :: Int
- replyMinor :: Int
- replyStatus :: Int
- replyMessage :: String
- replyHeaders :: Headers
- data Range
- data Headers = Headers {
- httpAccept :: Maybe [(MediaType, Int)]
- httpAcceptCharset :: Maybe [(String, Int)]
- httpAcceptEncoding :: Maybe [(String, Int)]
- httpAcceptLanguage :: Maybe [(String, Int)]
- httpAcceptRanges :: Bool
- httpAge :: Maybe Int64
- httpAllow :: Maybe [Method]
- httpAuthorization :: Maybe ByteString
- httpCookie :: [Cookie]
- httpConnectionClose :: Bool
- httpConnection :: [String]
- httpContentEncodings :: [String]
- httpContentLanguage :: Maybe [String]
- httpContentLength :: Maybe Int64
- httpContentLocation :: Maybe ByteString
- httpContentRange :: Maybe (Maybe (Int64, Int64), Maybe Int64)
- httpContentType :: Maybe MediaType
- httpDate :: Maybe UTCTime
- httpETag :: Maybe (Bool, ByteString)
- httpExpires :: Maybe UTCTime
- httpHost :: Maybe ByteString
- httpIfMatch :: Maybe (Either () [ByteString])
- httpIfModifiedSince :: Maybe UTCTime
- httpIfNoneMatch :: Maybe (Either () [(Bool, ByteString)])
- httpIfRange :: Maybe (Either ByteString UTCTime)
- httpIfUnmodifiedSince :: Maybe UTCTime
- httpKeepAlive :: Maybe Int
- httpLastModified :: Maybe UTCTime
- httpLocation :: Maybe ByteString
- httpPragma :: Maybe [(String, Maybe String)]
- httpProxyAuthenticate :: Maybe ByteString
- httpProxyAuthorization :: Maybe ByteString
- httpRange :: Maybe [Range]
- httpReferer :: Maybe ByteString
- httpRetryAfter :: Maybe Int64
- httpServer :: Maybe ByteString
- httpSetCookie :: [Cookie]
- httpTrailer :: Maybe [String]
- httpTransferEncoding :: [String]
- httpUserAgent :: Maybe ByteString
- httpWWWAuthenticate :: Maybe ByteString
- httpOtherHeaders :: Map ByteString ByteString
- data Cookie = Cookie {}
- emptyHeaders :: Headers
- emptyCookie :: Cookie
- statusToMessage :: Int -> String
- data Method
- type MediaType = ((String, String), [(String, String)])
- putRequest :: Request -> Put
- putReply :: Reply -> Put
- parseRequest :: BinaryParser m => m Request
- parseReply :: BinaryParser m => m Reply
- parseChunkHeader :: BinaryParser m => m Int64
Documentation
A HTTP request
A HTTP reply
Reply | |
|
A HTTP range
HTTP headers, see RFC 2616 section 14
A HTTP Cookie. See http://en.wikipedia.org/wiki/HTTP_cookie
Cookie | |
|
statusToMessage :: Int -> StringSource
Convert a status code to a message (e.g. 200 -> OK)
The list of valid methods, see RFC 2616 section 5.1
putRequest :: Request -> PutSource
parseRequest :: BinaryParser m => m RequestSource
parseReply :: BinaryParser m => m ReplySource
parseChunkHeader :: BinaryParser m => m Int64Source