ugi 0.2.1

Runtime-agnostic Rust request client with HTTP/1.1, HTTP/2, HTTP/3, H2C, WebSocket, SSE, and gRPC support
Documentation
use futures_lite::StreamExt;
use futures_lite::future::block_on;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    block_on(async move {
        let client = ugi::Client::builder().build()?;
        let res = client
            .get("https://stream.example.com/events")
            .header("accept", "text/event-stream")?
            .await?;

        let mut body = res.bytes_stream();
        while let Some(chunk) = body.next().await {
            let chunk = chunk?;
            print!("{}", String::from_utf8_lossy(&chunk));
        }

        Ok(())
    })
}