Skip to content

vvvinceocam/reqwest-sse

Repository files navigation

reqwest-sse

Made With Rust Crates.io Docs.rs

reqwest-sse is a lightweight Rust library that extends reqwest by adding native support for handling Server-Sent Events (SSE) . It introduces the EventSource trait, which enhances reqwest's Response type with an ergonomic .events() method. This method transforms the response body into an asynchronous stream of SSE events, enabling seamless integration of real-time event handling in applications using the familiar reqwest HTTP client.

⚠️ This library is experimental and shouldn't be used in production.

Example

use reqwest_sse::EventSource;
use tokio_stream::StreamExt;

let events = reqwest::get("https://example.com/events")
    .await?
    .events()
    .await?
    .collect::<Vec<_>>();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published