delhpi:http超时设置(转载)

时间:2022-07-02 10:03:22

原文地址:http://www.delphitop.com/html/kongjian/544.html

var
FHTTPClient:TIdHTTP;
begin
FHTTPClient := TIdHTTP.Create( Self );
with FHTTPClient do
begin
Disconnect;
Request.Pragma := 'no-cache';
Request.CacheControl := 'no-cache';
Request.Connection := 'close';
ReadTimeout := 1000 * 60 * 1;//1分钟超时
memo1.Text :=Get( 'http://hk.news.yahoo.com/busi/general/prnewswire/' );
end;
freeandnil(FHTTPClient);