According to the docs on Hyper.rs,
If you are looking for a convenient HTTP client, then you may wish to consider
reqwest. If you are looking for a convenient HTTP server, then you may wish to considerwarp. Both are built on top of this library.
Looking at the api, it seems Hyper.rs is already pretty high level. It supports proxies, tls, and cookies... Why is Reqwest more high level?
Hyper requires you to take care of lower level details, like parsing the URI (example from the documentation):
let client = Client::new();
let uri = "http://httpbin.org/ip".parse()?;
let mut resp = client.get(uri).await?;
while let Some(chunk) = resp.body_mut().data().await {
stdout().write_all(&chunk?).await?;
}
while reqwest handle this for you (from docs.rs) :
let body = reqwest::get("https://www.rust-lang.org")
.await?
.text()
.await?;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With