Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | Anders Kaseorg <andersk@mit.edu> |
Safe Haskell | Safe-Inferred |
Network.Multipart
Contents
Description
Parsing of the multipart format from RFC2046. Partly based on code from WASHMail.
- data MultiPart = MultiPart [BodyPart]
- data BodyPart = BodyPart Headers ByteString
- parseMultipartBody :: String -> ByteString -> MultiPart
- hGetMultipartBody :: String -> Handle -> IO MultiPart
- showMultipartBody :: String -> MultiPart -> ByteString
- type Headers = [(HeaderName, String)]
- newtype HeaderName = HeaderName String
- data ContentType = ContentType {}
- data ContentTransferEncoding = ContentTransferEncoding String
- data ContentDisposition = ContentDisposition String [(String, String)]
- parseContentType :: Monad m => String -> m ContentType
- getContentType :: Monad m => Headers -> m ContentType
- getContentTransferEncoding :: Monad m => Headers -> m ContentTransferEncoding
- getContentDisposition :: Monad m => Headers -> m ContentDisposition
Multi-part messages
Constructors
BodyPart Headers ByteString |
Arguments
:: String | Boundary |
-> ByteString | |
-> MultiPart |
Read a multi-part message from a ByteString
.
Read a multi-part message from a Handle
.
Fails on parse errors.
showMultipartBody :: String -> MultiPart -> ByteStringSource
Headers
type Headers = [(HeaderName, String)]Source
HTTP headers.
newtype HeaderName Source
A string with case insensitive equality and comparisons.
Constructors
HeaderName String |
Instances
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 | |
Fields
|
data ContentTransferEncoding Source
Constructors
ContentTransferEncoding String |
data ContentDisposition Source
Constructors
ContentDisposition String [(String, String)] |
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.
getContentType :: Monad m => Headers -> m ContentTypeSource
getContentDisposition :: Monad m => Headers -> m ContentDispositionSource