Copyright | (c) Peter Thiemann 20012002 (c) Bjorn Bringert 2005-2006 (c) Lemmih 2007 |
---|---|
License | BSD-style |
Maintainer | lemmih@vo.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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 :: MonadFail m => SourceName -> String -> m [Header]
- data ContentType = ContentType {}
- getContentType :: MonadFail m => [Header] -> m ContentType
- parseContentType :: MonadFail m => String -> m ContentType
- showContentType :: ContentType -> String
- data ContentTransferEncoding = ContentTransferEncoding String
- getContentTransferEncoding :: MonadFail m => [Header] -> m ContentTransferEncoding
- parseContentTransferEncoding :: MonadFail m => String -> m ContentTransferEncoding
- data ContentDisposition = ContentDisposition String [(String, String)]
- getContentDisposition :: MonadFail m => [Header] -> m ContentDisposition
- parseContentDisposition :: MonadFail m => String -> m ContentDisposition
- parseM :: MonadFail m => Parser a -> SourceName -> String -> m a
Headers
parseHeaders :: MonadFail 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 | |
|
Instances
Read ContentType Source # | |
Defined in Happstack.Server.Internal.RFC822Headers readsPrec :: Int -> ReadS ContentType # readList :: ReadS [ContentType] # readPrec :: ReadPrec ContentType # readListPrec :: ReadPrec [ContentType] # | |
Show ContentType Source # | |
Defined in Happstack.Server.Internal.RFC822Headers showsPrec :: Int -> ContentType -> ShowS # show :: ContentType -> String # showList :: [ContentType] -> ShowS # | |
Eq ContentType Source # | |
Defined in Happstack.Server.Internal.RFC822Headers (==) :: ContentType -> ContentType -> Bool # (/=) :: ContentType -> ContentType -> Bool # | |
Ord ContentType Source # | |
Defined in Happstack.Server.Internal.RFC822Headers compare :: ContentType -> ContentType -> Ordering # (<) :: ContentType -> ContentType -> Bool # (<=) :: ContentType -> ContentType -> Bool # (>) :: ContentType -> ContentType -> Bool # (>=) :: ContentType -> ContentType -> Bool # max :: ContentType -> ContentType -> ContentType # min :: ContentType -> ContentType -> ContentType # |
getContentType :: MonadFail m => [Header] -> m ContentType Source #
parseContentType :: MonadFail m => String -> m ContentType Source #
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 Source #
Produce the standard string representation of a content-type, e.g. "text/html; charset=ISO-8859-1".
Content-transfer-encoding
data ContentTransferEncoding Source #
Instances
getContentTransferEncoding :: MonadFail m => [Header] -> m ContentTransferEncoding Source #
Content-disposition
data ContentDisposition Source #
Instances
Read ContentDisposition Source # | |
Show ContentDisposition Source # | |
Defined in Happstack.Server.Internal.RFC822Headers showsPrec :: Int -> ContentDisposition -> ShowS # show :: ContentDisposition -> String # showList :: [ContentDisposition] -> ShowS # | |
Eq ContentDisposition Source # | |
Defined in Happstack.Server.Internal.RFC822Headers (==) :: ContentDisposition -> ContentDisposition -> Bool # (/=) :: ContentDisposition -> ContentDisposition -> Bool # | |
Ord ContentDisposition Source # | |
Defined in Happstack.Server.Internal.RFC822Headers compare :: ContentDisposition -> ContentDisposition -> Ordering # (<) :: ContentDisposition -> ContentDisposition -> Bool # (<=) :: ContentDisposition -> ContentDisposition -> Bool # (>) :: ContentDisposition -> ContentDisposition -> Bool # (>=) :: ContentDisposition -> ContentDisposition -> Bool # max :: ContentDisposition -> ContentDisposition -> ContentDisposition # min :: ContentDisposition -> ContentDisposition -> ContentDisposition # |
getContentDisposition :: MonadFail m => [Header] -> m ContentDisposition Source #
parseContentDisposition :: MonadFail m => String -> m ContentDisposition Source #