Jump to content

Recommended Posts

Posted

Hi all,

Do you have some idea, what could be wrong. Sometimes works, sometimes no. Obviously some interruption happens, instead of result I got 301: Interrupted.

After app is complete loaded there is lover possibility to get error. If I put to mainForm.OnCreate then approximately every third call failed.

URL call API server, result is XML string to fill ClientDatset. There is no difference if the function is on MainModule or MainForm.

Br, marko.

function TUniMainModule.getData(url:String;clt:TclientDataset):String;
var
  http:TipwHTTp;
begin
 try
  clt.Close;
  http:=TipwHTTp.create(self);
  http.FollowRedirects:=fralways;
  http.timeout:=10;
  http.get(url);
  clt.xmldata:=http.TransferredData;
  http.free;
  result:='OK';
 Except
  on e:Exception do
  begin
    Result:='response from API: '+e.Message+', api: '+ http.URL+', Reason: '+http.StatusLine ;
  end;
 end;
end;

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...