Expand description
The content_negotiation
module deals with handling media types, languages, charsets and
encodings as per https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
Structs§
- Charset
- Struct to represent a character set
- Encoding
- Struct to represent an encoding
- Media
Language - Struct to represent a media language
- Media
Type - Struct to represent a media type
Enums§
- Media
Type Match - Enum to represent a match with media types
Functions§
- acceptable_
content_ type - Determines if the media type accepted by the resource matches the media type provided by the client. Returns the match if there is one.
- matching_
charset - Determines if the charsets produced by the resource matches the acceptable charsets provided by the client. Returns the match if there is one.
- matching_
content_ type - Determines if the media types produced by the resource matches the acceptable media types provided by the client. Returns the match if there is one.
- matching_
encoding - Determines if the encodings supported by the resource matches the acceptable encodings provided by the client. Returns the match if there is one.
- matching_
language - Determines if the languages produced by the resource matches the acceptable languages provided by the client. Returns the match if there is one.
- sort_
encodings - Sorts the list of encodings by weighting as per https://tools.ietf.org/html/rfc2616#section-14.3. Note that identity encoding is awlays added with a weight of 1 if not already present.
- sort_
media_ charsets - Sorts the list of charsets by weighting as per https://tools.ietf.org/html/rfc2616#section-14.2. Note that ISO-8859-1 is added as a default with a weighting of 1 if not all ready supplied.
- sort_
media_ languages - Sorts the list of media types by weighting
- sort_
media_ types - Sorts the list of media types by their weights