Struct hyper::header::Cookie [] [src]

pub struct Cookie(pub Vec<CookiePair>);

Cookie header, defined in RFC6265

If the user agent does attach a Cookie header field to an HTTP request, the user agent must send the cookie-string as the value of the header field.

When the user agent generates an HTTP request, the user agent MUST NOT attach more than one Cookie header field.

Example values

  • SID=31d4d96e407aad42
  • SID=31d4d96e407aad42; lang=en-US

Example

use hyper::header::{Headers, Cookie};
use cookie::Cookie as CookiePair;

let mut headers = Headers::new();

headers.set(
   Cookie(vec![
       CookiePair::new("foo".to_owned(), "bar".to_owned())
   ])
);