18 lines
		
	
	
		
			401 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			401 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![deny(warnings)]
 | |
| 
 | |
| // This is using the `tokio` runtime. You'll need the following dependency:
 | |
| //
 | |
| // `tokio = { version = "0.2", features = ["macros"] }`
 | |
| #[tokio::main]
 | |
| async fn main() -> Result<(), reqwest::Error> {
 | |
|     let res = reqwest::get("https://hyper.rs").await?;
 | |
| 
 | |
|     println!("Status: {}", res.status());
 | |
| 
 | |
|     let body = res.text().await?;
 | |
| 
 | |
|     println!("Body:\n\n{}", body);
 | |
| 
 | |
|     Ok(())
 | |
| }
 |