13

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 consider warp. 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?

Evan Carroll
  • 78,363
  • 46
  • 261
  • 468

1 Answers1

15

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?;
Clément Joly
  • 858
  • 9
  • 27