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…
Date: Thu, 24 Aug 2006


I am using Delphi 2006 and indy.

I use the following code to get the HTML from the website

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);
        IdHTTP2.IOHandler := IdSSLIOHandlerSocketOpenSSL2;
        IdSSLIOHandlerSocketOpenSSL2.Host      := '';
        IdSSLIOHandlerSocketOpenSSL2.Port      := 443;
        IdHTTP2.HandleRedirects := True;


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.