simple_sse_http 1.0.0 copy "simple_sse_http: ^1.0.0" to clipboard
simple_sse_http: ^1.0.0 copied to clipboard

An implementation of the `SseClient` interface using the `http` package.

Simple SSE HTTP #

An implementation of the simple_sse SseClient interface using the http package.

Features #

Open an SSE connection and receive a stream of SseEvent objects using the simple_sse package behind the scenes.

Usage #

Add this package to your app's dependencies:

dart pub add simple_sse_http

Use the HttpSseClient to open a connection and receive a stream of SseEvent objects.

final client = HttpSseClient();
final Stream<SseEvent> events = client.connect(Uri.parse('https://sse.dev/test'));

await for (final SseEvent event in events) {
    // SseEvent(id: 123, event: 'event', data: 'data', retry: 123)
    print(event.toString()); 
}
0
likes
160
points
6
downloads

Publisher

verified publisherandyhorn.dev

Weekly Downloads

An implementation of the `SseClient` interface using the `http` package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

http, simple_sse

More

Packages that depend on simple_sse_http