chiark / gitweb /
Experimented with a reqwest Client.
authorSimon Tatham <anakin@pobox.com>
Sat, 23 Dec 2023 11:15:12 +0000 (11:15 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 23 Dec 2023 11:15:12 +0000 (11:15 +0000)
src/main.rs

index 216ed42500b13551cad7a1cf84f50c4050306b18..df089dd0baa08d223a9dcf5120550a763b25c7c5 100644 (file)
@@ -118,9 +118,10 @@ struct Status {
 }
 
 fn main() {
-    let body = reqwest::blocking::get(
+    let client = reqwest::blocking::Client::new();
+    let body = client.get(
         "https://hachyderm.io/api/v1/statuses/111602135142646031")
-        .unwrap().text().unwrap();
+        .send().unwrap().text().unwrap();
     let st: Status = serde_json::from_str(&body).unwrap();
     dbg!(st);
 }