ugi 0.2.1

Runtime-agnostic Rust request client with HTTP/1.1, HTTP/2, HTTP/3, H2C, WebSocket, SSE, and gRPC support
Documentation
#[cfg(feature = "h2")]
use futures_lite::future::block_on;

#[cfg(feature = "h2")]
fn main() -> Result<(), Box<dyn std::error::Error>> {
    block_on(async move {
        let client = ugi::Client::builder()
            .http2_only()
            .danger_accept_invalid_certs(true)
            .build()?;

        let res = client.get("https://localhost:8443/health").await?;
        let body = res.text().await?;

        println!("{body}");
        Ok(())
    })
}

#[cfg(not(feature = "h2"))]
fn main() {
    eprintln!("This example requires the `h2` feature.");
}