首页 > 技术文章 > delhpi:http超时设置(转载)

huiy 2018-09-14 10:56 原文

原文地址: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);

推荐阅读