- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi IDHTTP 断开连接/超时读取
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);