TsgcHTTP2ClientProperties › Active

Active Property

Opens or closes the HTTP/2 connection to the remote server.

Syntax

property Active: Boolean read GetActive write SetActive;

Default Value

False

Remarks

Set Active to True to establish the TCP/TLS connection, negotiate HTTP/2 (using ALPN when TLS is enabled) and start the preface/SETTINGS exchange. Set it to False to close the connection gracefully. Calling an HTTP/2 method such as Get or Post automatically activates the component when required, so assigning Active explicitly is usually only needed when you want to keep a long-lived HTTP/2 connection open between requests.

Example


oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.Active := True;

Back to Properties