>_ RESTERM
v1.18.2

examples Protocols

sse_scripted.http

An SSE feed checked by captures and @assert.

runs as-is

shell
resterm run _examples/sse_scripted.http

Run this from the root of a clone of the Resterm repository.

Editor
### Scripted SSE Monitor
# @name SSEScriptedMonitor
# @sse idle=5s duration=20s max-events=5
# @assert stream.enabled() => "stream should be enabled"
# @assert len(stream.events()) > 0 => "expected at least one SSE event"
# @assert stream.summary().eventCount > 0 => "summary tracks event count"
# Wikimedia starts every stream with an "ok" comment, so the first data event
# is at index 1.
# @capture request firstEvent {{stream.events[1].data}}
# @capture file lastReason {{stream.summary.reason}}
GET https://stream.wikimedia.org/v2/stream/recentchange
User-Agent: resterm-examples (https://github.com/unkn0wn-root/resterm)

_examples/sse_scripted.http on GitHub

WebSocket and SSE docs
Search

↑↓ moveEnter openEsc close

Help

These keys work like the ones in the TUI.

/
Search the docs (also Ctrl K)
j k
Scroll down and up
g g G
Jump to the top or the bottom
[ ]
Previous and next page
g d
Docs index
g h
Home page
t
Switch between dark and light
?
Show this help
Esc
Close a dialog