The previously default Client is moved to `reqwest::blocking`, while the async client becomes the main API. Closes #622
		
			
				
	
	
		
			18 lines
		
	
	
		
			318 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			318 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![deny(warnings)]
 | |
| 
 | |
| #[tokio::main]
 | |
| async fn main() -> Result<(), reqwest::Error> {
 | |
|     let mut res = reqwest::Client::new()
 | |
|         .get("https://hyper.rs")
 | |
|         .send()
 | |
|         .await?;
 | |
| 
 | |
|     println!("Status: {}", res.status());
 | |
| 
 | |
|     let body = res.text().await?;
 | |
| 
 | |
|     println!("Body:\n\n{}", body);
 | |
| 
 | |
|     Ok(())
 | |
| }
 |