feat(header): add Connection::close() and ::keep_alive() constructors

This commit is contained in:
Sean McArthur
2015-05-11 18:48:33 -07:00
parent a6dd9c8476
commit c2938fb45f
3 changed files with 14 additions and 4 deletions

View File

@@ -56,7 +56,6 @@ use std::io::Read;
use hyper::Client;
use hyper::header::Connection;
use hyper::header::ConnectionOption;
fn main() {
// Create a client.
@@ -65,7 +64,7 @@ fn main() {
// Creating an outgoing request.
let mut res = client.get("http://www.gooogle.com/")
// set a header
.header(Connection(vec![ConnectionOption::Close]))
.header(Connection::close())
// let 'er go!
.send().unwrap();