Struct http_stub::header::Connection [] [src]

pub struct Connection(pub Vec<ConnectionOption>);

Connection header, defined in RFC7230

The Connection header field allows the sender to indicate desired control options for the current connection. In order to avoid confusing downstream recipients, a proxy or gateway MUST remove or replace any received connection options before forwarding the message.

ABNF

Connection        = 1#connection-option
connection-option = token

# Example values
* `close`
* `keep-alive`
* `upgrade`

Examples

use hyper::header::{Headers, Connection};

let mut headers = Headers::new();
headers.set(Connection::keep_alive());
// extern crate unicase;

use hyper::header::{Headers, Connection, ConnectionOption};
use unicase::UniCase;

let mut headers = Headers::new();
headers.set(
    Connection(vec![
        ConnectionOption::ConnectionHeader(UniCase("upgrade".to_owned())),
    ])
);