Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Dormouse.Client.Headers.MediaType
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
Constructors
MediaType | |
Fields
|
data ContentType Source #
Constructors
Text | |
Image | |
Audio | |
Video | |
Application | |
Multipart | |
Other (CI ByteString) |
Instances
Eq ContentType Source # | |
Defined in Dormouse.Client.Headers.MediaType | |
Show ContentType Source # | |
Defined in Dormouse.Client.Headers.MediaType Methods 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 Methods showsPrec :: Int -> MediaTypeException -> ShowS # show :: MediaTypeException -> String # showList :: [MediaTypeException] -> ShowS # | |
Exception MediaTypeException Source # | |
Defined in Dormouse.Client.Exception Methods toException :: MediaTypeException -> SomeException # fromException :: SomeException -> Maybe MediaTypeException # |
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