v2026.4.1
All Bundles

SSEStream

Server-Sent Events (SSE) stream reader. Reads events from an HTTP text/event-stream response line by line.

client := HttpsClient->New();
client->AddHeader("Authorization", "Bearer ...");
stream := client->StreamPost(url, body, "application/json");
if(stream <> Nil) {
  while(stream->HasNext()) {
    event := stream->Next();
    event->GetData()->PrintLine();
  };
  stream->Close();
};

Operations

Close

Closes the underlying connection

method : public : Close() ~ Nil

GetStatusCode

Gets the HTTP status code

method : public : GetStatusCode() ~ Int

Return

TypeDescription
Intstatus code

HasNext

Checks if more events are available

method : public : HasNext() ~ Bool

Return

TypeDescription
Booltrue if another event can be read

Next

Returns the next SSE event. Call HasNext() first.

method : public : Next() ~ SSEEvent

Return

TypeDescription
SSEEventnext event