Re: Connect and Get

Giganews Newsgroups
Subject: Re: Connect and Get
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Mon, 24 Apr 2006

"Alan" <alanpltseNOSP…@yahoo.com.au> wrote in message
news:D15E42BBE2F5E240alanpltseNOSP…@yahoo.com.au...

> IdHTTP1.Connect('office.mycompany.com');

Get rid of that.  You should never call Connect() directly when using
TIdHTTP.  Get() and Post() call Connect() internally.

> IdHTTP1.Get('office.mycompany.com\mypicture.jpg');

That is not a valid URL.  You need to use this instead:

    IdHTTP1.Get(http://office.mycompany.com/mypicture.jpg');

> I got an exception:
> EIdUnknownProtocol with message ".

That is because you did not specify the 'http://' portion of the URL.

> How do I know I connected successfully

You won't get an exception thrown.

Gambit

Replies

In response to

Connect and Get posted by Alan on Mon, 24 Apr 2006