| Copyright | (c) Peter Thiemann 20012002 (c) Bjorn Bringert 2005-2006 |
|---|---|
| License | BSD-style |
| Maintainer | Anders Kaseorg <andersk@mit.edu> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Network.Multipart.Header
Description
Parsing of HTTP headers (name, value pairs) Partly based on code from WASHMail.
Synopsis
- type Headers = [(HeaderName, String)]
- newtype HeaderName = HeaderName String
- class HeaderValue a where
- parseHeaderValue :: Parser a
- prettyHeaderValue :: a -> String
- pHeaders :: Parser Headers
- data ContentType = ContentType {}
- getContentType :: MonadFail m => Headers -> m ContentType
- parseContentType :: MonadFail m => String -> m ContentType
- showContentType :: ContentType -> String
- data ContentTransferEncoding = ContentTransferEncoding String
- getContentTransferEncoding :: MonadFail m => Headers -> m ContentTransferEncoding
- data ContentDisposition = ContentDisposition String [(String, String)]
- getContentDisposition :: MonadFail m => Headers -> m ContentDisposition
- parseM :: MonadFail m => Parser a -> SourceName -> String -> m a
- caseInsensitiveEq :: String -> String -> Bool
- caseInsensitiveCompare :: String -> String -> Ordering
- lexeme :: Parser a -> Parser a
- ws1 :: Parser Char
- p_token :: Parser String
Headers
type Headers = [(HeaderName, String)] Source #
HTTP headers.
newtype HeaderName Source #
A string with case insensitive equality and comparisons.
Constructors
| HeaderName String |
Instances
| Show HeaderName Source # | |
Defined in Network.Multipart.Header | |
| Eq HeaderName Source # | |
Defined in Network.Multipart.Header Methods (==) :: HeaderName -> HeaderName -> Bool Source # (/=) :: HeaderName -> HeaderName -> Bool Source # | |
| Ord HeaderName Source # | |
Defined in Network.Multipart.Header Methods compare :: HeaderName -> HeaderName -> Ordering Source # (<) :: HeaderName -> HeaderName -> Bool Source # (<=) :: HeaderName -> HeaderName -> Bool Source # (>) :: HeaderName -> HeaderName -> Bool Source # (>=) :: HeaderName -> HeaderName -> Bool Source # max :: HeaderName -> HeaderName -> HeaderName Source # min :: HeaderName -> HeaderName -> HeaderName Source # | |
class HeaderValue a where Source #
Instances
| HeaderValue ContentDisposition Source # | |
Defined in Network.Multipart.Header Methods | |
| HeaderValue ContentTransferEncoding Source # | |
Defined in Network.Multipart.Header | |
| HeaderValue ContentType Source # | |
Defined in Network.Multipart.Header Methods | |
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
| |
Instances
| Read ContentType Source # | |
Defined in Network.Multipart.Header | |
| Show ContentType Source # | |
Defined in Network.Multipart.Header | |
| Eq ContentType Source # | |
Defined in Network.Multipart.Header Methods (==) :: ContentType -> ContentType -> Bool Source # (/=) :: ContentType -> ContentType -> Bool Source # | |
| Ord ContentType Source # | |
Defined in Network.Multipart.Header Methods compare :: ContentType -> ContentType -> Ordering Source # (<) :: ContentType -> ContentType -> Bool Source # (<=) :: ContentType -> ContentType -> Bool Source # (>) :: ContentType -> ContentType -> Bool Source # (>=) :: ContentType -> ContentType -> Bool Source # max :: ContentType -> ContentType -> ContentType Source # min :: ContentType -> ContentType -> ContentType Source # | |
| HeaderValue ContentType Source # | |
Defined in Network.Multipart.Header Methods | |
getContentType :: MonadFail m => Headers -> 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 #
Content-transfer-encoding
data ContentTransferEncoding Source #
Constructors
| ContentTransferEncoding String |
Instances
getContentTransferEncoding :: MonadFail m => Headers -> m ContentTransferEncoding Source #
Content-disposition
data ContentDisposition Source #
Constructors
| ContentDisposition String [(String, String)] |
Instances
| Read ContentDisposition Source # | |
Defined in Network.Multipart.Header | |
| Show ContentDisposition Source # | |
Defined in Network.Multipart.Header | |
| Eq ContentDisposition Source # | |
Defined in Network.Multipart.Header Methods (==) :: ContentDisposition -> ContentDisposition -> Bool Source # (/=) :: ContentDisposition -> ContentDisposition -> Bool Source # | |
| Ord ContentDisposition Source # | |
Defined in Network.Multipart.Header Methods compare :: ContentDisposition -> ContentDisposition -> Ordering Source # (<) :: ContentDisposition -> ContentDisposition -> Bool Source # (<=) :: ContentDisposition -> ContentDisposition -> Bool Source # (>) :: ContentDisposition -> ContentDisposition -> Bool Source # (>=) :: ContentDisposition -> ContentDisposition -> Bool Source # max :: ContentDisposition -> ContentDisposition -> ContentDisposition Source # min :: ContentDisposition -> ContentDisposition -> ContentDisposition Source # | |
| HeaderValue ContentDisposition Source # | |
Defined in Network.Multipart.Header Methods | |
getContentDisposition :: MonadFail m => Headers -> m ContentDisposition Source #