Struct hyper::header::AcceptEncoding
[−]
[src]
pub struct AcceptEncoding(pub Vec<QualityItem<Encoding>>);
Accept-Encoding
header, defined in
RFC7231
The Accept-Encoding
header field can be used by user agents to
indicate what response content-codings are
acceptable in the response. An identity
token is used as a synonym
for "no encoding" in order to communicate when no encoding is
preferred.
ABNF
Accept-Encoding = #( codings [ weight ] )
codings = content-coding / "identity" / "*"
Example values
compress, gzip
- ``
*
compress;q=0.5, gzip;q=1
gzip;q=1.0, identity; q=0.5, *;q=0
Examples
use hyper::header::{Headers, AcceptEncoding, Encoding, qitem}; let mut headers = Headers::new(); headers.set( AcceptEncoding(vec![qitem(Encoding::Chunked)]) );
use hyper::header::{Headers, AcceptEncoding, Encoding, qitem}; let mut headers = Headers::new(); headers.set( AcceptEncoding(vec![ qitem(Encoding::Chunked), qitem(Encoding::Gzip), qitem(Encoding::Deflate), ]) );
use hyper::header::{Headers, AcceptEncoding, Encoding, QualityItem, Quality, qitem}; let mut headers = Headers::new(); headers.set( AcceptEncoding(vec![ qitem(Encoding::Chunked), QualityItem::new(Encoding::Gzip, Quality(600)), QualityItem::new(Encoding::EncodingExt("*".to_owned()), Quality(0)), ]) );