searching the web…
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp = reqwest::get("https://httpbin.org/ip")
.await?
.json::<HashMap<String, String>>()
.await?;
println!("{resp:#?}");
Ok(())
}Reqwest is the idiomatic async HTTP client for Rust, built on tokio. Use #[tokio::main] to enable async runtime and .await to handle futures.