Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data MediaType = MediaType {
- mainType :: ContentType
- subType :: CI ByteString
- suffixes :: [CI ByteString]
- parameters :: Map (CI ByteString) ByteString
- data ContentType
- = Text
- | Image
- | Audio
- | Video
- | Application
- | Multipart
- | Other (CI ByteString)
- data MediaTypeException
- parseMediaType :: MonadThrow m => ByteString -> m MediaType
- encodeMediaType :: MediaType -> ByteString
- applicationJson :: MediaType
- applicationXWWWFormUrlEncoded :: MediaType
- textHtml :: MediaType
Documentation
A Media Type indicates the format of content which can be transferred over the wire
MediaType | |
|
data ContentType Source #
Instances
Eq ContentType Source # | |
Defined in Dormouse.Client.Headers.MediaType (==) :: ContentType -> ContentType -> Bool # (/=) :: ContentType -> ContentType -> Bool # | |
Show ContentType Source # | |
Defined in Dormouse.Client.Headers.MediaType showsPrec :: Int -> ContentType -> ShowS # show :: ContentType -> String # showList :: [ContentType] -> ShowS # |
data MediaTypeException Source #
MediaTypeException
is used to indicate an error parsing a MediaType header such as "Content-Type" into a valid MediaType
Instances
Show MediaTypeException Source # | |
Defined in Dormouse.Client.Exception showsPrec :: Int -> MediaTypeException -> ShowS # show :: MediaTypeException -> String # showList :: [MediaTypeException] -> ShowS # | |
Exception MediaTypeException Source # | |
Defined in Dormouse.Client.Exception |
parseMediaType :: MonadThrow m => ByteString -> m MediaType Source #
Parse a Media Type from an ASCII ByteString
encodeMediaType :: MediaType -> ByteString Source #
Encode a Media Type as an ASCII ByteString
applicationJson :: MediaType Source #
The application/json
Media Type
applicationXWWWFormUrlEncoded :: MediaType Source #
The application/x-www-form-urlencoded
Media Type