Discussion:
TIdHTTP component
(too old to reply)
Shao Chin
2007-06-02 20:37:02 UTC
Permalink
Hi, I'm trying to write an applicatoin that downloads a web page given a URL. I know there is an Indy component called TIdHTTP that can do this in two lines of code:
TFileStream *fs = new TFileStream(filename, fmCreate);
IdHTTP->DoRequest(hmGet,url,NULL,fs);
Which will download a page into a file. However, I can't find this component anywhere on the internet (all download sites are out of date). I'm running BC++ Builder 5.0 Professional. Does anyone how to do this in BC++ 5.0 without this Indy component?
THanks!
Shao
Remy Lebeau (TeamB)
2007-06-04 20:11:00 UTC
Permalink
Post by Shao Chin
IdHTTP->DoRequest(hmGet,url,NULL,fs);
Use the Get() method instead of the DoRequest() method directly:

IdHTTP->Get(url, fs);
Post by Shao Chin
However, I can't find this component anywhere on the internet
Indy ships preinstalled with BCB 6+. Otherwise, download it from the
official Indy website: http://www.indyproject.org)
Post by Shao Chin
Does anyone how to do this in BC++ 5.0 without this Indy
component?
You can use Microsoft's WinInet or WinHTTP APIs. Otherwise, you have
to write your own HTTP code from scratch using TClientSocket or
WinSock API calls directly, or use another third-party
component/library, such as ICS or Synapse.


Gambit
shao chin
2007-06-07 05:27:14 UTC
Permalink
Thanks!
It turns out that the TNMHTTP component in BC++ 5.0 can do the same thing, using NMHTTP1->Get(url).
By the way, http://www.indyproject.org doesn't work any more. All downloads have been removed.

Shao
Post by Remy Lebeau (TeamB)
Post by Shao Chin
IdHTTP->DoRequest(hmGet,url,NULL,fs);
IdHTTP->Get(url, fs);
Post by Shao Chin
However, I can't find this component anywhere on the internet
Indy ships preinstalled with BCB 6+. Otherwise, download it from the
official Indy website: http://www.indyproject.org)
Post by Shao Chin
Does anyone how to do this in BC++ 5.0 without this Indy
component?
You can use Microsoft's WinInet or WinHTTP APIs. Otherwise, you have
to write your own HTTP code from scratch using TClientSocket or
WinSock API calls directly, or use another third-party
component/library, such as ICS or Synapse.
Gambit
Remy Lebeau (TeamB)
2007-06-08 20:03:04 UTC
Permalink
Post by shao chin
It turns out that the TNMHTTP component in BC++ 5.0 can
do the same thing, using NMHTTP1->Get(url).
The Netmaster components are notoriously buggy and unreliable. That's
why Borland doesn't bundle them anymore.
Post by shao chin
By the way, http://www.indyproject.org doesn't work any more.
Works fine for me.
Post by shao chin
All downloads have been removed.
No, they have not. I just tried it and everything downloaded fine.


Gambit
unknown
2007-07-17 10:07:51 UTC
Permalink
Post by Remy Lebeau (TeamB)
Post by shao chin
By the way, http://www.indyproject.org doesn't work any more.
Works fine for me.
Post by shao chin
All downloads have been removed.
No, they have not. I just tried it and everything downloaded fine.
Works fine for me too. What planet is this guy on?
--
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
Loading...