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
GetStatusCode
Gets the HTTP status code
method : public : GetStatusCode() ~ IntReturn
| Type | Description |
|---|---|
| Int | status code |
HasNext
Checks if more events are available
method : public : HasNext() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if another event can be read |
Next
Returns the next SSE event. Call HasNext() first.
method : public : Next() ~ SSEEventReturn
| Type | Description |
|---|---|
| SSEEvent | next event |