Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Mar : Re: Conditional TidHttp.GET()
| Subject: | Re: Conditional TidHttp.GET() |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Tue, 6 Mar 2007 10:58:09 |
"Joe Aley" <joealey2003@yahoo.com> wrote in message
news:45eccbc1$1@newsgroups.borland.com...
> IdHTTP1.Request.LastModified := Now();
That is pretty useless. It is almost impossible to download a page
that is beng modified at the exact moment that it is being downloaded,
so you will always get a 304 reply and never the actual data. You
should be specifying an older date/time, such as when you were able to
last download the data, otherwise checking for 'if-modified-since' is
meaningless.
> except on E : Exception do begin
TIdHTTP raises an EIdHTTPProtocolException when a 304 is received, so
you could alternatively check for that, ie:
except on E : EIdHTTPProtocolException do begin
if E.ReplyErrorCode = 304 then begin
Gambit
none