IdHTTP.GET only works for me on second attempt?

Giganews Newsgroups
Subject: IdHTTP.GET only works for me on second attempt?
Posted by:  Jayc Salter (ja…@registriesltd.com.au)
Date: Thu, 24 Aug 2006

Hi

I am using Delphi 2006 and indy.

I use the following code to get the HTML from the website
https://www.asxonline.com

I find that the first time i click the button (running this code) i get
a "Read Timeout" error on the idHTTP.GET but when i press it a second
time it works correctly.

procedure TForm2.Button1Click(Sender: TObject);
begin
        IdHTTP2.IOHandler := IdSSLIOHandlerSocketOpenSSL2;
        IdSSLIOHandlerSocketOpenSSL2.Host      := 'www.asxonline.com';
        IdSSLIOHandlerSocketOpenSSL2.Port      := 443;
        IdHTTP2.HandleRedirects := True;

        RichEdit1.Clear;
        RichEdit1.Lines.Add(IdHTTP2.Get('https://www.asxonline.com'));
end;

All the other settings of the TidHttp and TIdSSLIOHandlerSocketOpenSSL
are the defaults (i have experimented with most of them to see if they help)

has anyone got any ideas?
Thanks for the help.

Replies