multipart-0.2.1: Parsers for the HTTP multipart format

Copyright(c) Peter Thiemann 20012002
(c) Bjorn Bringert 2005-2006
LicenseBSD-style
MaintainerAnders Kaseorg <andersk@mit.edu>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Network.Multipart

Contents

Description

Parsing of the multipart format from RFC2046. Partly based on code from WASHMail.

Synopsis

Multi-part messages

data BodyPart Source #

Instances
Eq BodyPart Source # 
Instance details

Defined in Network.Multipart

Ord BodyPart Source # 
Instance details

Defined in Network.Multipart

Show BodyPart Source # 
Instance details

Defined in Network.Multipart

parseMultipartBody Source #

Arguments

:: String

Boundary

-> ByteString 
-> MultiPart 

Read a multi-part message from a ByteString.

hGetMultipartBody Source #

Arguments

:: String

Boundary

-> Handle 
-> IO MultiPart 

Read a multi-part message from a Handle. Fails on parse errors.

Headers

type Headers = [(HeaderName, String)] Source #

HTTP headers.

newtype HeaderName Source #

A string with case insensitive equality and comparisons.

Constructors

HeaderName String 

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

  • ctType :: String

    The top-level media type, the general type of the data. Common examples are "text", "image", "audio", "video", "multipart", and "application".

  • ctSubtype :: String

    The media subtype, the specific data format. Examples include "plain", "html", "jpeg", "form-data", etc.

  • ctParameters :: [(String, String)]

    Media type parameters. On common example is the charset parameter for the "text" top-level type, e.g. ("charset","ISO-8859-1").

data ContentTransferEncoding Source #

Instances
Eq ContentTransferEncoding Source # 
Instance details

Defined in Network.Multipart.Header

Ord ContentTransferEncoding Source # 
Instance details

Defined in Network.Multipart.Header

Read ContentTransferEncoding Source # 
Instance details

Defined in Network.Multipart.Header

Show ContentTransferEncoding Source # 
Instance details

Defined in Network.Multipart.Header

HeaderValue ContentTransferEncoding Source # 
Instance details

Defined in Network.Multipart.Header

data ContentDisposition 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 MonadFail with a (hopefully) informative error message.