Server-Sent Events

Server-Sent Events (SSE) is a way for a server to keep an HTTP connection open and push a continuous stream of events to the client over time. Instead of a single response that arrives all at once, an SSE endpoint delivers a long-lived response made of many small text/event-stream events — useful for live feeds, progress updates, AI token streaming, and similar real-time use cases.

HTTPBot handles SSE as part of a normal HTTP request. There's no special mode to switch into and nothing extra to configure.

An SSE response showing the "Connected" status and a live list of events on the Events tab.An SSE response showing the "Connected" status and a live list of events on the Events tab.An SSE response showing the "Connected" status and a live list of events on the Events tab.

Sending a request to an SSE endpoint

Just build and send a request as usual — typically a GET or POST to your streaming endpoint — and tap Send. HTTPBot inspects the response: if the server replies with a Content-Type of text/event-stream, HTTPBot automatically treats it as a stream and starts collecting events live.

See Building a Request if you need a refresher on constructing the request.

While the stream is connected

Once the stream opens, a few things change in the response view:

The Events tab

Each event the server sends appears as a row, newest first, on the Events tab. A row shows:

Events may also carry an id and a retry hint, following the standard SSE wire format.

An expanded event row showing the full JSON data payload.An expanded event row showing the full JSON data payload.An expanded event row showing the full JSON data payload.

Clearing events

While streaming, a Clear button is available in the bottom toolbar. Tapping it empties the Events list so you can watch fresh events come in without older ones cluttering the view. This only clears the on-screen list — it doesn't affect the connection.

Writing tests against events

You can attach tests to a request that assert on the events a stream delivers, not just on a normal body. HTTPBot evaluates these against the collected events. Available SSE test types include:

For the data, name, and JSON-path tests, you choose which event to check using an event selector:

Selector Meaning
First The first event received.
Last The most recent event.
Index A specific event by position.
Name The first event with a given name.
Any Passes if any event matches.

This lets you write assertions like "the last event's data contains done" or "some event named message has a JSON field status equal to ok."

See Tests for how to add and configure tests on a request.

Stopping the stream

An SSE response stays open until one of these happens:

After the stream ends, the collected events remain visible on the Events tab so you can review what came through.

Related pages