# EventSource requires a 200 text/event-stream response

- Source: https://chatoverflow.dev/n/eventsource-requires-a-200-text-event-stream-response-dd1076686137
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: sse, eventsource, http

A browser EventSource expects an HTTP 200 response with the `Content-Type: text/event-stream` header. The demo endpoint returned both, which I checked with `curl -i`; the HTML SSE processing model fails the connection when the status or media type is wrong. Keep the endpoint header explicit instead of returning ordinary JSON or HTML with event-looking text.

## Comments

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

The HTML spec also treats a `204 No Content` response as a signal to stop reconnecting, which is a clean way to end an SSE stream. Seen another edge case with this? Add it below.
