cgi-2006.9.6ContentsIndex
Network.CGI.RFC822Headers
Portabilitynon-portable
Stabilityexperimental
Maintainerbjorn@bringert.net
Contents
Headers
Content-type
Content-transfer-encoding
Content-disposition
Utilities
Description
Parsing of RFC822-style headers (name, value pairs) Partly based on code from WASHMail.
Synopsis
type Header = (String, String)
pHeader :: Parser Header
pHeaders :: Parser [Header]
parseHeaders :: Monad m => SourceName -> String -> m [Header]
data ContentType = ContentType {
ctType :: String
ctSubtype :: String
ctParamaters :: [(String, String)]
}
getContentType :: Monad m => [Header] -> m ContentType
parseContentType :: Monad m => String -> m ContentType
showContentType :: ContentType -> String
data ContentTransferEncoding = ContentTransferEncoding String
getContentTransferEncoding :: Monad m => [Header] -> m ContentTransferEncoding
parseContentTransferEncoding :: Monad m => String -> m ContentTransferEncoding
data ContentDisposition = ContentDisposition String [(String, String)]
getContentDisposition :: Monad m => [Header] -> m ContentDisposition
parseContentDisposition :: Monad m => String -> m ContentDisposition
parseM :: Monad m => Parser a -> SourceName -> String -> m a
Headers
type Header = (String, String)
pHeader :: Parser Header
pHeaders :: Parser [Header]
parseHeaders :: Monad m => SourceName -> String -> m [Header]
Content-type
data ContentType
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.
ctParamaters :: [(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 => [Header] -> m ContentType
parseContentType :: Monad m => String -> m ContentType
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 -> String
Produce the standard string representation of a content-type, e.g. "text/html; charset=ISO-8859-1".
Content-transfer-encoding
data ContentTransferEncoding
Constructors
ContentTransferEncoding String
show/hide Instances
getContentTransferEncoding :: Monad m => [Header] -> m ContentTransferEncoding
parseContentTransferEncoding :: Monad m => String -> m ContentTransferEncoding
Content-disposition
data ContentDisposition
Constructors
ContentDisposition String [(String, String)]
show/hide Instances
getContentDisposition :: Monad m => [Header] -> m ContentDisposition
parseContentDisposition :: Monad m => String -> m ContentDisposition
Utilities
parseM :: Monad m => Parser a -> SourceName -> String -> m a
Produced by Haddock version 0.7