fix(readme): Make the README client example work

`res` needs to be unwrapped, we want to print out `body`, and `res` doesn't need to be mutable.
This commit is contained in:
Emily Eisenberg
2015-02-05 21:13:05 -08:00
parent c2784bca7a
commit 9b5d6aab7e

View File

@@ -46,16 +46,16 @@ fn main() {
let mut client = Client::new();
// Creating an outgoing request.
let mut res = client.get("http://www.gooogle.com/")
let res = client.get("http://www.gooogle.com/")
// set a header
.header(Connection(vec![Close]))
// let 'er go!
.send();
.send().unwrap();
// Read the Response.
let body = res.read_to_string().unwrap();
println!("Response: {}", res);
println!("Response: {}", body);
}
```