markokas Posted August 10, 2021 Posted August 10, 2021 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; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.