uses System.Net, System.Info;

HttpQuery.SetConnectTimeoutMSec(100);
HttpQuery.SetReceiveTimeoutMSec(100);

var t := SystemMilliseconds + 3000;
repeat
   var d := '';
   if HttpQuery.GetData('http://localhost/', d) = 200 then break;
until SystemMilliseconds > t;

