typed_headers/impls/
content_type.rs

1use http::header::CONTENT_TYPE;
2
3use mime::Mime;
4
5header! {
6    /// `Content-Type` header, defined in
7    /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-3.1.1.5)
8    ///
9    /// The `Content-Type` header field indicates the media type of the
10    /// associated representation: either the representation enclosed in the
11    /// message payload or the selected representation, as determined by the
12    /// message semantics.  The indicated media type defines both the data
13    /// format and how that data is intended to be processed by a recipient,
14    /// within the scope of the received message semantics, after any content
15    /// codings indicated by Content-Encoding are decoded.
16    ///
17    /// # ABNF
18    ///
19    /// ```text
20    /// Content-Type = media-type
21    /// ```
22    ///
23    /// # Example values
24    ///
25    /// * `text/html; charset=utf-8`
26    /// * `application/json`
27    (ContentType, CONTENT_TYPE) => [Mime]
28}