You can use serde_json::Value.
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp = reqwest::get("https://httpbin.org/ip")
.await?
.json::<serde_json::Value>()
.await?;
println!("{:#?}", resp);
Ok(())
}
You will have to add serde_json
to your Cargo.toml file.
[dependencies]
...
serde_json = "1"