Skip to content

Commit ae4039a

Browse files
author
Bastian Gruber
committed
Update minimal-reqwest example
1 parent df6b5aa commit ae4039a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ch_01/hello/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ch_01/minimal_reqwest/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
use std::collections::HashMap;
2+
13
#[tokio::main]
24
async fn main() -> Result<(), Box<dyn std::error::Error>> {
35
let resp = reqwest::get("https://httpbin.org/ip")
6+
.await?
7+
.json::<HashMap<String, String>>()
48
.await?;
5-
println!("{:?}", resp);
9+
println!("{:#?}", resp);
610
Ok(())
711
}

0 commit comments

Comments
 (0)