Skip to content

TFPCustomHTTPClient.GetEventSource

Creates a Server-Sent Events connection

Declaration

Source position: fphttpclient.pp line 293

public 
function TFPCustomHTTPClient.GetEventSource(const aMethod: string; 
                                           const aURL: string; 
                                           const aBody: string='')
                                            : TCustomHTTPEventSource;

Description

Establishes a Server-Sent Events connection to the specified URL and returns an event source for reading events. The connection uses the specified HTTP method and optional request body.

Errors

May raise HTTP-related exceptions on connection errors.

See also

Name Description
TCustomHTTPEventSource Base class for Server-Sent Events (SSE) client
TFPHTTPClient.OnEventStream Event called when a Server-Sent Events stream is established