EllaSource codeContentsIndex
Ella.CGI.Header
Portabilitynon-portable
Stabilityexperimental
Maintainerbjorn@bringert.net
Contents
Headers
Content-type
Content-transfer-encoding
Content-disposition
Utilities
Description

Parsing of HTTP headers (name, value pairs). Partly based on code from WASHMail.

Copied directly from the CGI package -- it cannot be imported as this module is not exposed

Synopsis
type Headers = [(HeaderName, String)]
newtype HeaderName = HeaderName String
class HeaderValue a where
parseHeaderValue :: Parser a
prettyHeaderValue :: a -> String
pHeaders :: Parser Headers
data ContentType = ContentType {
ctType :: String
ctSubtype :: String
ctParameters :: [(String, String)]
}
getContentType :: Monad m => Headers -> m ContentType
parseContentType :: Monad m => String -> m ContentType
showContentType :: ContentType -> String
data ContentTransferEncoding = ContentTransferEncoding String
getContentTransferEncoding :: Monad m => Headers -> m ContentTransferEncoding
data ContentDisposition = ContentDisposition String [(String, String)]
getContentDisposition :: Monad m => Headers -> m ContentDisposition
parseM :: Monad m => Parser a -> SourceName -> String -> m a
caseInsensitiveEq :: String -> String -> Bool
caseInsensitiveCompare :: String -> String -> Ordering
lexeme :: Parser a -> Parser a
ws1 :: Parser Char
p_token :: Parser String
Headers
type Headers = [(HeaderName, String)]Source
HTTP headers.
newtype HeaderName Source
A string with case insensitive equality and comparisons.
Constructors
HeaderName String
show/hide Instances
class HeaderValue a whereSource
Methods
parseHeaderValue :: Parser aSource
prettyHeaderValue :: a -> StringSource
show/hide Instances
pHeaders :: Parser HeadersSource
Content-type
data ContentType Source
A MIME media type value. The Show instance is derived automatically. Use showContentType to obtain the standard string representation. See http://www.ietf.org/rfc/rfc2046.txt for more information about MIME media types.
Constructors
ContentType
ctType :: StringThe top-level media type, the general type of the data. Common examples are "text", "image", "audio", "video", "multipart", and "application".
ctSubtype :: StringThe media subtype, the specific data format. Examples include "plain", "html", "jpeg", "form-data", etc.
ctParameters :: [(String, String)]Media type parameters. On common example is the charset parameter for the "text" top-level type, e.g. ("charset","ISO-8859-1").
show/hide Instances
getContentType :: Monad m => Headers -> m ContentTypeSource
parseContentType :: Monad m => String -> m ContentTypeSource
Parse the standard representation of a content-type. If the input cannot be parsed, this function calls fail with a (hopefully) informative error message.
showContentType :: ContentType -> StringSource
Content-transfer-encoding
data ContentTransferEncoding Source
Constructors
ContentTransferEncoding String
show/hide Instances
getContentTransferEncoding :: Monad m => Headers -> m ContentTransferEncodingSource
Content-disposition
data ContentDisposition Source
Constructors
ContentDisposition String [(String, String)]
show/hide Instances
getContentDisposition :: Monad m => Headers -> m ContentDispositionSource
Utilities
parseM :: Monad m => Parser a -> SourceName -> String -> m aSource
caseInsensitiveEq :: String -> String -> BoolSource
caseInsensitiveCompare :: String -> String -> OrderingSource
lexeme :: Parser a -> Parser aSource
ws1 :: Parser CharSource
RFC 822 LWSP-char
p_token :: Parser StringSource
Produced by Haddock version 2.4.2