upgrade hyper to v0.11
This commit is contained in:
		
							
								
								
									
										16
									
								
								examples/async.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								examples/async.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| extern crate futures; | ||||
| extern crate reqwest; | ||||
| extern crate tokio_core; | ||||
|  | ||||
| use futures::Future; | ||||
|  | ||||
| fn main() { | ||||
|     let mut core = tokio_core::reactor::Core::new().unwrap(); | ||||
|     let client = reqwest::unstable::async::Client::new(&core.handle()).unwrap(); | ||||
|  | ||||
|     let work = client.get("https://hyper.rs").unwrap().send().map(|res| { | ||||
|         println!("{}", res.status()); | ||||
|     }); | ||||
|  | ||||
|     core.run(work).unwrap(); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user