| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Network.HTTP.Media.MediaType
Contents
Description
Defines the MediaType accept header with an Accept instance for use
in content-type negotiation.
Synopsis
- data MediaType
- type Parameters = Map (CI ByteString) (CI ByteString)
- (//) :: ByteString -> ByteString -> MediaType
- (/:) :: MediaType -> (ByteString, ByteString) -> MediaType
- mainType :: MediaType -> CI ByteString
- subType :: MediaType -> CI ByteString
- parameters :: MediaType -> Parameters
- (/?) :: MediaType -> ByteString -> Bool
- (/.) :: MediaType -> ByteString -> Maybe (CI ByteString)
Type and creation
An HTTP media type, consisting of the type, subtype, and parameters.
Instances
| IsString MediaType # | |
Defined in Network.HTTP.Media.MediaType.Internal Methods fromString :: String -> MediaType # | |
| Show MediaType # | |
| Eq MediaType # | |
| Ord MediaType # | |
Defined in Network.HTTP.Media.MediaType.Internal | |
| Accept MediaType # | |
Defined in Network.HTTP.Media.MediaType.Internal Methods parseAccept :: ByteString -> Maybe MediaType # matches :: MediaType -> MediaType -> Bool # moreSpecificThan :: MediaType -> MediaType -> Bool # | |
| RenderHeader MediaType # | |
Defined in Network.HTTP.Media.MediaType.Internal Methods renderHeader :: MediaType -> ByteString # | |
type Parameters = Map (CI ByteString) (CI ByteString) #
MediaType parameters.
(//) :: ByteString -> ByteString -> MediaType #
Builds a MediaType without parameters. Can produce an error if
either type is invalid.
(/:) :: MediaType -> (ByteString, ByteString) -> MediaType #
Adds a parameter to a MediaType. Can produce an error if either
string is invalid.
Querying
parameters :: MediaType -> Parameters #
Retrieves the parameters of a MediaType.
(/?) :: MediaType -> ByteString -> Bool #
Evaluates if a MediaType has a parameter of the given name.
(/.) :: MediaType -> ByteString -> Maybe (CI ByteString) #
Retrieves a parameter from a MediaType.