Thursday, 04 April 2024
  2 Replies
  44 Visits
  Subscribe
Hello Sergio,
I'm using the TsgcHTTP2Client component to send requests to the HTTP2 server based on the TsgcWebSocketHTTPServer component, but I'm having strange client behavior.
If after the first request (for example a GET), I disconnect the component and then reconnect it for a further request, it almost always fails (the request does not reach the server at all and the status is 0).
If the client always stays connected, it always works.
Am I doing something wrong or is it a bug?
I attach excerpts of the code.
Thank you


function TFormStoreSignature.DownLoadReport: Boolean;
begin
FClient_Request.Request.Accept := '*/*';
FClient_Request.Get(components[UrlIndex]+'/ReportDownLoad/'+components[InputFileIndex]);
Result := FClient_Request.Response.Status = 200;
FClient_Request.Disconnect;
if Result then begin
.....

function TFormStoreSignature.DownLoadSign: Boolean;
begin
try
FClient_Request.Active := True;
FClient_Request.Get(components[UrlIndex]+'/ImageSignatureDownLoad/medistore__' + Components[SessionIndex]);
Result := FClient_Request.Response.Status = 200;
FClient_Request.Disconnect;
if Result then begin
.....