MediaTypeHelper
abstract class MediaTypeHelper (View source)
Helper for dealing with HTTP media type resolution.
Methods
Get accepted media types for the given request.
Returns the best fitting IANA media type after applying the content negotiation rules on the accepted media types.
Parses a RFC 2616 content negotiation header field by evaluating the Quality Values and splitting the options into an array list, ordered by user preference.
Details
static array
determineAcceptedMediaTypes(RequestInterface $request)
Get accepted media types for the given request.
If no "Accept" header was found all media types are acceptable.
static string|null
negotiateMediaType(array $acceptedMediaTypes, array $supportedMediaTypes, bool $trim = true)
Returns the best fitting IANA media type after applying the content negotiation rules on the accepted media types.
static array
parseContentNegotiationQualityValues(string $rawValues)
Parses a RFC 2616 content negotiation header field by evaluating the Quality Values and splitting the options into an array list, ordered by user preference.