examples Protocols
streaming.http
The @sse and @websocket directives side by side, against public test servers.
runs as-is
resterm run --all _examples/streaming.httpRun this from the root of a clone of the Resterm repository.
Editor
WebSocket and SSE docs### Server Sent Events Demo
# @name sseDemo
# @description Demonstrates streaming responses over SSE.
# @sse duration=30s idle=10s max-events=5
GET https://stream.wikimedia.org/v2/stream/recentchange
Accept: text/event-stream
User-Agent: resterm-examples (https://github.com/unkn0wn-root/resterm)
### WebSocket Chat Demo
# @name wsChat
# @description Sends a message over WebSocket and waits for a reply.
# @websocket idle=3s subprotocols=chat.v1
# @ws send Hello from resterm!
# @ws wait 1s
# @ws close 1000 normal closure
GET wss://echo.websocket.org