Lines may end in \n, \r\n or \r, and may be split across reads.
One read may hold several events.
Comment lines (: ...) are skipped. Providers use them as keep-alives.
A blank line ends an event. An event with no data: line is skipped.
The last event is still given when the body ends without a blank line.
Payloads such as [DONE] are given as normal data. The caller decides
when to stop. Stopping early (a break in for await) cancels the body.
Aborting signal cancels the body and throws the abort reason.
Reads SSE events from a response body, in order.
\n,\r\nor\r, and may be split across reads.: ...) are skipped. Providers use them as keep-alives.data:line is skipped.Payloads such as
[DONE]are given as normaldata. The caller decides when to stop. Stopping early (abreakinfor await) cancels the body. Abortingsignalcancels the body and throws the abort reason.