Module content_type
Available on crate features
http and std only.Expand description
The Content-Type a recipient acts on, read as browsers do, so a proxy or server agrees
with them:
extract_mime_typeandextract_essenceread a response as browsers do: WHATWG Fetch’s lenient “extract a MIME type” (§3.5) over every field line.parse_essenceandparse_mime_typejudge a request as the CORS safelist does: MIME Sniffing’s “parse a MIME type” (§4.4) over the whole value. A decision that gates a request uses it, as the lenient reading findsapplication/jsonin atext/plain;,application/jsonsent without preflight.
Functions§
- extract_
essence - The
type/subtypeof the extracted type, as sent: all a decision on the media type needs. - extract_
mime_ type - The extracted type with its parameters,
Nonewhen no line holds a valid one. - parse_
essence - The
type/subtypeof the whole value as one media type, as sent: what the CORS safelist judges, so a request is gated on the type its sender was allowed to send. - parse_
mime_ type - The whole value as one media type with the parameters the
mimecrate can hold, seeparse_essence.