cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Detecting If-Modified-Since failure

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 27 Nov 2002 13:13:12 +0100 (MET)

On Wed, 27 Nov 2002, Ben Martin wrote:

> Just a quick check, when one does
> curl_easy_setopt( c, CURLOPT_TIMECONDITION, TIMECOND_IFMODSINCE );
> curl_easy_setopt( c, CURLOPT_TIMEVALUE, mtime );
> perform();
>
> is the recommended way to test if the file has been changed and thus
> downloaded to test the HTTP code CURLINFO_EFFECTIVE_URL ?

If you get data downloaded, you know that the condition was true (it has been
modified since), and if the condition was false, you'll get nothing and a
304-reply (that you can see with curl_easy_getinfo and CURLINFO_HTTP_CODE).

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
Received on 2002-11-27