Portability | portable |
---|---|
Stability | experimental |
Maintainer | lemmih@vo.com |
Safe Haskell | None |
Parsing of RFC822-style headers (name, value pairs) Partly based on code from WASHMail.
- type Header = (String, String)
- pHeader :: Parser Header
- pHeaders :: Parser [Header]
- parseHeaders :: Monad m => SourceName -> String -> m [Header]
- data ContentType = ContentType {
- ctType :: String
- ctSubtype :: String
- ctParameters :: [(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
parseHeaders :: Monad m => SourceName -> String -> m [Header]Source
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.
ContentType | |
|
Eq ContentType | |
Ord ContentType | |
Read ContentType | |
Show ContentType |
getContentType :: Monad m => [Header] -> 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
Produce the standard string representation of a content-type, e.g. "text/html; charset=ISO-8859-1".
Content-transfer-encoding
data ContentTransferEncoding Source
ContentTransferEncoding String |
getContentTransferEncoding :: Monad m => [Header] -> m ContentTransferEncodingSource
parseContentTransferEncoding :: Monad m => String -> m ContentTransferEncodingSource
Content-disposition
data ContentDisposition Source
ContentDisposition String [(String, String)] |
Eq ContentDisposition | |
Ord ContentDisposition | |
Read ContentDisposition | |
Show ContentDisposition |
getContentDisposition :: Monad m => [Header] -> m ContentDispositionSource
parseContentDisposition :: Monad m => String -> m ContentDispositionSource