Files
reqwest-impersonate/examples/async.rs
Sean McArthur ba7b2a754e refactor all to async/await (#617)
Co-authored-by: Danny Browning <danny.browning@protectwise.com>
Co-authored-by: Daniel Eades <danieleades@hotmail.com>
2019-09-06 17:22:56 -07:00

17 lines
313 B
Rust

#![deny(warnings)]
use reqwest::r#async::Client;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let mut res = Client::new().get("https://hyper.rs").send().await?;
println!("Status: {}", res.status());
let body = res.text().await?;
println!("Body:\n\n{}", body);
Ok(())
}