network-minihttp-0.2: A ByteString based library for writing HTTP(S) servers and clients.

Network.MiniHTTP.Marshal

Description

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.

Synopsis

Documentation

data Request Source

A HTTP request

Instances

data Reply Source

A HTTP reply

Instances

data Range Source

A HTTP range

Constructors

RangeFrom Int64

everything from the given byte onwards

RangeOf Int64 Int64

the bytes in the given range, inclusive

RangeSuffix Int64

the final n bytes

Instances

data Headers Source

HTTP headers, see RFC 2616 section 14

Constructors

Headers 

Fields

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
 

Instances

statusToMessage :: Int -> StringSource

Convert a status code to a message (e.g. 200 -> OK)

data Method Source

The list of valid methods, see RFC 2616 section 5.1

Constructors

OPTIONS 
GET 
HEAD 
POST 
PUT 
DELETE 
TRACE 
CONNECT