Files
reqwest-impersonate/examples/simple.rs
2019-12-17 12:56:36 -08:00

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(())
}