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.



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 status indicator shows Connected instead of a final status/size/time summary, because the response is still open.
- The Send button becomes Stop, so you can end the stream whenever you like.
- An Events tab appears and fills with events as they arrive.
The Events tab
Each event the server sends appears as a row, newest first, on the Events tab. A row shows:
- A timestamp of when the event arrived.
- The event name (the
event:field), if the server set one — for examplemessageordone. - The data payload (the
data:field). Long payloads are truncated in the list; tap a row to expand it and read the full data.
Events may also carry an id and a retry hint, following the standard SSE wire format.



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:
- Event count — assert how many events were received (e.g. at least 3).
- Event data — assert on an event's data payload.
- Event name — assert on an event's name.
- Event JSON path — extract a value from inside an event's JSON data and assert on it.
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:
- You tap Stop (the Send button while connected).
- The server closes the stream.
- The connection drops or errors out.
After the stream ends, the collected events remain visible on the Events tab so you can review what came through.