Struct http_stub::header::Prefer [] [src]

pub struct Prefer(pub Vec<Preference>);

Prefer header, defined in RFC7240

The Prefer header field is HTTP header field that can be used by a client to request that certain behaviors be employed by a server while processing a request.

ABNF

Prefer     = "Prefer" ":" 1#preference
preference = token [ BWS "=" BWS word ]
             *( OWS ";" [ OWS parameter ] )
parameter  = token [ BWS "=" BWS word ]

Example values

Examples

use hyper::header::{Headers, Prefer, Preference};

let mut headers = Headers::new();
headers.set(
    Prefer(vec![Preference::RespondAsync])
);
use hyper::header::{Headers, Prefer, Preference};

let mut headers = Headers::new();
headers.set(
    Prefer(vec![
        Preference::RespondAsync,
        Preference::ReturnRepresentation,
        Preference::Wait(10u32),
        Preference::Extension("foo".to_owned(),
                              "bar".to_owned(),
                              vec![]),
    ])
);