diff options
Diffstat (limited to 'main.rs')
-rw-r--r-- | main.rs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -121,6 +121,7 @@ fn main() { }; println!("requesting..."); + /* let work = client.request(req).and_then(|res| { res.body().for_each(move |body: hyper::Chunk| { println!("hmmm"); @@ -128,6 +129,13 @@ fn main() { Ok(()) }) }); + */ + + let work = client.request(req).and_then(|res| { + res.body() + .map(|chunk| futures::stream::iter(chunk.into_iter().map(|b| -> Result<u8, hyper::Error> { Ok(b) }))) + .flatten().for_each(|byte| Ok(print!("{}", byte as char))) + }); println!("Before?"); let resp = core.run(work).unwrap(); |