-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | HTTP multipart split out of the cgi package
--
-- HTTP multipart split out of the cgi package
@package multipart
@version 0.1.2
-- | Parsing of HTTP headers (name, value pairs) Partly based on code from
-- WASHMail.
module Network.Multipart.Header
-- | HTTP headers.
type Headers = [(HeaderName, String)]
-- | A string with case insensitive equality and comparisons.
newtype HeaderName
HeaderName :: String -> HeaderName
class HeaderValue a
parseHeaderValue :: HeaderValue a => Parser a
prettyHeaderValue :: HeaderValue a => a -> String
pHeaders :: Parser Headers
-- | 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.
data ContentType
ContentType :: String -> String -> [(String, String)] -> ContentType
-- | The top-level media type, the general type of the data. Common
-- examples are "text", "image", "audio", "video", "multipart", and
-- "application".
ctType :: ContentType -> String
-- | The media subtype, the specific data format. Examples include "plain",
-- "html", "jpeg", "form-data", etc.
ctSubtype :: ContentType -> String
-- | Media type parameters. On common example is the charset parameter for
-- the "text" top-level type, e.g. ("charset","ISO-8859-1").
ctParameters :: ContentType -> [(String, String)]
getContentType :: Monad m => Headers -> 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.
parseContentType :: Monad m => String -> m ContentType
showContentType :: ContentType -> String
data ContentTransferEncoding
ContentTransferEncoding :: String -> ContentTransferEncoding
getContentTransferEncoding :: Monad m => Headers -> m ContentTransferEncoding
data ContentDisposition
ContentDisposition :: String -> [(String, String)] -> ContentDisposition
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
-- | RFC 822 LWSP-char
ws1 :: Parser Char
p_token :: Parser String
instance Show HeaderName
instance Show ContentType
instance Read ContentType
instance Show ContentTransferEncoding
instance Read ContentTransferEncoding
instance Eq ContentTransferEncoding
instance Ord ContentTransferEncoding
instance Show ContentDisposition
instance Read ContentDisposition
instance Eq ContentDisposition
instance Ord ContentDisposition
instance HeaderValue ContentDisposition
instance HeaderValue ContentTransferEncoding
instance HeaderValue ContentType
instance Ord ContentType
instance Eq ContentType
instance Ord HeaderName
instance Eq HeaderName
-- | Parsing of the multipart format from RFC2046. Partly based on code
-- from WASHMail.
module Network.Multipart
data MultiPart
MultiPart :: [BodyPart] -> MultiPart
data BodyPart
BodyPart :: Headers -> ByteString -> BodyPart
-- | Read a multi-part message from a ByteString.
parseMultipartBody :: String -> ByteString -> MultiPart
-- | Read a multi-part message from a Handle. Fails on parse errors.
hGetMultipartBody :: String -> Handle -> IO MultiPart
showMultipartBody :: String -> MultiPart -> ByteString
-- | HTTP headers.
type Headers = [(HeaderName, String)]
-- | A string with case insensitive equality and comparisons.
newtype HeaderName
HeaderName :: String -> HeaderName
-- | 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.
data ContentType
ContentType :: String -> String -> [(String, String)] -> ContentType
-- | The top-level media type, the general type of the data. Common
-- examples are "text", "image", "audio", "video", "multipart", and
-- "application".
ctType :: ContentType -> String
-- | The media subtype, the specific data format. Examples include "plain",
-- "html", "jpeg", "form-data", etc.
ctSubtype :: ContentType -> String
-- | Media type parameters. On common example is the charset parameter for
-- the "text" top-level type, e.g. ("charset","ISO-8859-1").
ctParameters :: ContentType -> [(String, String)]
data ContentTransferEncoding
ContentTransferEncoding :: String -> ContentTransferEncoding
data ContentDisposition
ContentDisposition :: String -> [(String, String)] -> ContentDisposition
-- | Parse the standard representation of a content-type. If the input
-- cannot be parsed, this function calls fail with a (hopefully)
-- informative error message.
parseContentType :: Monad m => String -> m ContentType
getContentType :: Monad m => Headers -> m ContentType
getContentTransferEncoding :: Monad m => Headers -> m ContentTransferEncoding
getContentDisposition :: Monad m => Headers -> m ContentDisposition
instance Show BodyPart
instance Eq BodyPart
instance Ord BodyPart
instance Show MultiPart
instance Eq MultiPart
instance Ord MultiPart