Re: Conditional TidHttp.GET()

Giganews Newsgroups
Subject: Re: Conditional TidHttp.GET()
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Mon, 5 Mar 2007

"Joe Aley" <joealey20…@yahoo.com> wrote in message
news:45ecbff3$…@newsgroups.borland.com...

> I am guessing that i will have to write a header somewhere
> with the "if-modified-since" date.
>
> How is that?

Set the TIdHTTP.Request.LastModified property before calling Get().

Note - if you are using Indy 9 or earlier, Get() will throw an
exception if it receives a 304 reply, though.  You will have to wrap
the call in a try..except block, and then check the
TIdHTTP.Response.ResponseCode property in the except section.

If you are using Ind 10, on the other hand, then you can pass 304 to
Get()'s AIgnoreReplies parameter, and the exception will not be
thrown.

Gambit

Replies

In response to

Conditional TidHttp.GET() posted by Joe Aley on Mon, 05 Mar 2007