Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Oct : Delphi2007, Indy10, TidHttp, site returns 500 but has content
| Subject: | Delphi2007, Indy10, TidHttp, site returns 500 but has content |
| Posted by: | "dk_sz" (dk_..@hotmail.com) |
| Date: | Fri, 12 Oct 2007 21:21:55 |
Hi,
Sample code.
##
try
FHTTP.Get(AURI, Result);
except
on E: Exception do
begin
if (Result.Size = 0) and (Result.Position = 0) then
Result.CopyFrom(FHTTP.Response.ContentStream, 0)
end;
Problem:
##
If website returns reponse code 500, an exception
is thrown, and there is no way to get content.
This is a general problem with some variants of IIS
/ ASP pages server (at least only encountered
it with websites that appear to use above).
IE, FireFox etc. can view website even with response
code 500 (verified using FireFox Live HTTP Headers
which also states website returns response code 500).
I will be happy to email link to people if they do not
believe above scenario can happen, but I prefer not
to post it in usenet as it is not my website :-)
Anyways, does anyone have a workaround how
to get the content? Preferably still by using Indy.
best regards
Thomas Schulz