Coming from:
hyper = { version = "0.14.27", default-features = false }
I switched to hyper 1.0.1 but now I'm stuck upgrading the below code:
use hyper::{client::Client, Body, Request};
pub async fn ping(uri: &str) -> Result<()> {
let hyper_client = Client::new();
if let Err(e) = retry(5, 2, || {
let req = Request::builder()
.uri(uri.to_string())
.body(Body::empty())
.unwrap();
hyper_client.request(req)
})
.await
{
return "cannot ping!"
}
Ok(())
}
Can you help me understand what to use instead of client::Client now?
Should I use hyper_util::client::legacy::Client?
Why the word legacy in the name?
Or should I use all the code in https://github.com/hyperium/hyper/blob/master/examples/client.rs?
Coming from:
I switched to
hyper 1.0.1but now I'm stuck upgrading the below code:Can you help me understand what to use instead of
client::Clientnow?Should I use
hyper_util::client::legacy::Client?Why the word
legacyin the name?Or should I use all the code in https://github.com/hyperium/hyper/blob/master/examples/client.rs?