hpx 2.5.8

High Performance HTTP Client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Simple HTTP/3 example.
//!
//! This example demonstrates making a GET request to a public HTTP/3 server
//! using `http3_only()`.

#[tokio::main]
async fn main() -> hpx::Result<()> {
    let client = hpx::Client::builder().http3_only().build()?;

    let resp = client.get("https://cloudflare-quic.com/").send().await?;

    println!("Status: {}", resp.status());
    println!("Body: {}", resp.text().await?);
    Ok(())
}