TsgcHTTP2Client 实现了客户端 HTTP/2 组件,可连接到 HTTP/2 服务器。
TsgcHTTP2Client 实现了客户端 HTTP/2 组件,可以连接到 HTTP/2 服务器。请按照以下步骤配置此组件:
1. 创建一个新的 TsgcHTTP2Client 组件实例。
2. 向服务器发送请求,并使用 OnHTTP2Response 事件处理响应。示例:
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;