Struct http_stub::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

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)),
    ])
);