http-media-0.8.1.1: Processing HTTP Content-Type and Accept headers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.HTTP.Media.MediaType

Description

Defines the MediaType accept header with an Accept instance for use in content-type negotiation.

Synopsis

Type and creation

data MediaType #

An HTTP media type, consisting of the type, subtype, and parameters.

Instances

Instances details
IsString MediaType # 
Instance details

Defined in Network.HTTP.Media.MediaType.Internal

Methods

fromString :: String -> MediaType

Show MediaType # 
Instance details

Defined in Network.HTTP.Media.MediaType.Internal

Methods

showsPrec :: Int -> MediaType -> ShowS

show :: MediaType -> String

showList :: [MediaType] -> ShowS

Eq MediaType # 
Instance details

Defined in Network.HTTP.Media.MediaType.Internal

Methods

(==) :: MediaType -> MediaType -> Bool

(/=) :: MediaType -> MediaType -> Bool

Ord MediaType # 
Instance details

Defined in Network.HTTP.Media.MediaType.Internal

Methods

compare :: MediaType -> MediaType -> Ordering

(<) :: MediaType -> MediaType -> Bool

(<=) :: MediaType -> MediaType -> Bool

(>) :: MediaType -> MediaType -> Bool

(>=) :: MediaType -> MediaType -> Bool

max :: MediaType -> MediaType -> MediaType

min :: MediaType -> MediaType -> MediaType

Accept MediaType # 
Instance details

Defined in Network.HTTP.Media.MediaType.Internal

RenderHeader MediaType # 
Instance details

Defined in Network.HTTP.Media.MediaType.Internal

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

mainType :: MediaType -> CI ByteString #

Retrieves the main type of a MediaType.

subType :: MediaType -> CI ByteString #

Retrieves the sub type of a MediaType.

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.