TsgcHTTP2Client | HTTP/2 Partial Responses

Usually when you send an HTTP Request, server sends a response with the file requested, sometimes, instead of send a single response, server can send multiple response like a stream, in these cases you can use OnHTTP2ResponseFragment event to capture these responses and show to user.

 

Example: send a request to https://http2.golang.org/clockstream and server will send a stream response every second.

 


TsgcHTTP2Client oClient = new TsgcHTTP2Client();
oClient->OnHTTP2ResponseFragment = OnHTTP2ResponseFragmentEvent;
oClient->Get("https://http2.golang.org/clockstream");
...
void OnHTTP2ResponseFragmentEvent(TObject *Sender; const TsgcHTTP2ConnectionClient *Connection; 
  const TsgcHTTP2RequestProperty *Request; const TsgcHTTP2ResponseFragmentProperty *Fragment)
{
  ShowMessage(Fragment->DataString);
}