chiark
/
gitweb
/
~ian
/
mastodonochrome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97289f2
)
Experimented with a reqwest Client.
author
Simon Tatham
<anakin@pobox.com>
Sat, 23 Dec 2023 11:15:12 +0000
(11:15 +0000)
committer
Simon Tatham
<anakin@pobox.com>
Sat, 23 Dec 2023 11:15:12 +0000
(11:15 +0000)
src/main.rs
patch
|
blob
|
history
diff --git
a/src/main.rs
b/src/main.rs
index 216ed42500b13551cad7a1cf84f50c4050306b18..df089dd0baa08d223a9dcf5120550a763b25c7c5 100644
(file)
--- a/
src/main.rs
+++ b/
src/main.rs
@@
-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);
}