Jump to content

ipworks failed


markokas

Recommended Posts

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;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...