The response

HTTP/1.1 200 OK
Content-Type: text/event-stream
Cache-Control: no-cache
Connection: keep-alive

data: hello

data: world

Advertisement

Event fields

  • data: — the payload. Multiple data: lines concatenate with newlines.
  • event: — custom event name.
  • id: — sets last-event-id on the client.
  • retry: — override reconnect delay (ms).
Advertisement

Structured event example

event: user.joined
data: {"userId": "u1", "name": "Alice"}
id: 42