Usage with async-std? #3055
Answered
by
seanmonstar
WhyNotHugo
asked this question in
Q&A
|
Can use hyper::client::Client;
#[async_std::main]
async fn main() {
// Still inside `async fn main`...
let client = Client::new();
// Parse an `http::Uri`...
let uri = "http://httpbin.org/ip".parse().unwrap();
// Await the response...
let mut resp = client.get(uri).await.unwrap();
println!("Response: {}", resp.status());
}Yields: Given that both runtimes rely on rather standard rust features ( |
Answered by
seanmonstar
Nov 14, 2022
Replies: 2 comments 1 reply
|
You can, but you have to adapt it manually to the Alternatively, you can use surf, which uses |
0 replies
|
The default |
1 reply
Answer selected by
hawkw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The default
Clientuses anHttpConnectorwhich makes use oftokio::net::TcpStreams. You can disable the relevant features and bring your own runtime.