diff --git a/tokio-async-await/examples/src/hyper.rs b/tokio-async-await/examples/src/hyper.rs index c647cb941..458ee439f 100644 --- a/tokio-async-await/examples/src/hyper.rs +++ b/tokio-async-await/examples/src/hyper.rs @@ -8,6 +8,7 @@ use tokio::prelude::*; use hyper::Client; use std::time::Duration; +use std::str; pub fn main() { tokio::run_async(async { @@ -21,5 +22,12 @@ pub fn main() { }).unwrap(); println!("Response: {}", response.status()); + + let mut body = response.into_body(); + + while let Some(chunk) = await!(body.next()) { + let chunk = chunk.unwrap(); + println!("chunk = {}", str::from_utf8(&chunk[..]).unwrap()); + } }); }