ST3VO
asked on
Indy idhttpclient component question
Hi all,
I know how to use the idHttpClient.get to get headers and stuff....
How can I filter errors: 200, 404, 501 etc using the Indy component please?
thx
st3vo
I know how to use the idHttpClient.get to get headers and stuff....
How can I filter errors: 200, 404, 501 etc using the Indy component please?
thx
st3vo
Depends what your aim is with this: if this is analysis of your own site then you know what you do about 404's etc., but third-party sites often code up a more helpful 404 page, or simply fold the request back to the Home page.
Hi there
Take a Shot
Ralph
Take a Shot
Ralph
procedure TForm1.Button1Click(Sender: TObject);
begin
try
IdHTTP1.Get('http://www.google.com/goofypage.html');
except
on e:EIdHTTPProtocolException do
begin
showmessage(inttostr(e.ErrorCode));
showmessage(e.ToString);
end;
end;
end;
ASKER
Hi all,
I know how to capture the errors as above. What I need is to filter them...
For example:
If error := '404' then showmessage('Error is 404'); etc..
know what I mean?
I know how to capture the errors as above. What I need is to filter them...
For example:
If error := '404' then showmessage('Error is 404'); etc..
know what I mean?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect Thanks a million :o)
The answer given there was to parse the idHttpClient.Response property.