happstack-server-7.5.4: Web related tools and services.

Copyright(c) Peter Thiemann 20012002
(c) Bjorn Bringert 2005-2006
(c) Lemmih 2007
LicenseBSD-style
Maintainerlemmih@vo.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Happstack.Server.Internal.RFC822Headers

Contents

Description

Parsing of RFC822-style headers (name, value pairs) Partly based on code from WASHMail.

Synopsis

Headers

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.

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").

parseContentType :: Monad 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 #

Content-disposition

Utilities

parseM :: Monad m => Parser a -> SourceName -> String -> m a Source #