Re: IDHTTP GET ERROR


[ DelphiLand Discussion Forum ]

Posted by webmaster Guido on March 25, 2003 at 02:45:46:

In Reply to: IDHTTP GET ERROR posted by WS on March 25, 2003 at 00:49:03:

: I AM DOING THIS
: CAd := 'http://web.jce.do/consultas/FOTOS/MYFOTO.JPG';
: fs := TMemoryStream.Create;
: idhttp1.Get(Cad,fs)
: fs.SaveToFile('c:\seguro\fotos\'+ced+'.jpg');

: BUT I WOULD LIKE TO KNOW HOW TO GET THE EXCEPTION WHEN THE URL ON CAD DO NOT EXIST, BECAUSE MY PROGRAM IS BREAKING IN THAT CASE
-------

I suppose you are using Delphi's the TNMHTTP component. The Delphi help contains a table of the values that the ReplyNumber property can have (the last response number from the server):

The following is a list of standard HTTP responses and their meanings:

Number Meaning
100 Continue
and so on...
200 OK
and so on...
400 Bad Request
401 Unauthorized
404 Not Found
405 Method Not Allowed
500 Internal Server Error
and so on...

For all the details, look under TNMHTTP, property ReplyNumber.

There's also info about events that you can use, such as OnConnectionFailed, OnInvalidHost,...



Related Articles and Replies:


[ DelphiLand Discussion Forum ]