http_sse 0.1.0 copy "http_sse: ^0.1.0" to clipboard
http_sse: ^0.1.0 copied to clipboard

Server-Sent Events (SSE) events, encoders, and decoders.

http_sse #

Server-Sent Events (SSE) events, encoders, and decoders.

Usage #

import 'package:http_sse/http_sse.dart';

void main() async {
  // Encoding SSE events
  final events = Stream.fromIterable([
    const SseEvent.text('Hello World', event: 'greeting'),
    const SseEvent.json({'user': 'Alice'}, id: '1'),
  ]);

  final bytes = events.transform(const SseEncoder());

  // Decoding SSE stream
  final decoded = await bytes.transform(const SseDecoder()).toList();
}
0
likes
160
points
93
downloads

Documentation

API reference

Publisher

verified publisherpusk.software

Weekly Downloads

Server-Sent Events (SSE) events, encoders, and decoders.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

equatable, meta

More

Packages that depend on http_sse