TsgcHTTP2Client

TsgcHTTP2Client implements Client HTTP/2 Component and can connect to HTTP/2 servers.

Introduction

TsgcHTTP2Client implements Client HTTP/2 Component and can connect to HTTP/2 servers. Follow the steps below to configure this component:

 

1. Create a new instance of TsgcHTTP2Client component.

 

2. Send the request to server and process the response using OnHTTP2Response event. example:

 


    oClient := TsgcHTTP2Client.Create(nil);
    oClient.OnHTTP2Response := OnHTTP2ResponseEvent;
    oClient.Get('https://www.google.com');

    procedure OnHTTP2ResponseEvent(Sender: TObject; const
        Connection: TsgcHTTP2ConnectionClient; const Request:
        TsgcHTTP2RequestProperty; const Response: TsgcHTTP2ResponseProperty);
    begin
      ShowMessage(Response.DataString);
    end;

 

Reference

Guides