1CURLOPT_TIMECONDITION(3) curl_easy_setopt options CURLOPT_TIMECONDITION(3)
2
3
4
6 CURLOPT_TIMECONDITION - select condition for a time request
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMECONDITION, long
12 cond);
13
15 Pass a long as parameter. This defines how the CURLOPT_TIMEVALUE(3)
16 time value is treated. You can set this parameter to CURL_TIME‐
17 COND_IFMODSINCE or CURL_TIMECOND_IFUNMODSINCE.
18
19 The last modification time of a file is not always known and in such
20 instances this feature will have no effect even if the given time con‐
21 dition would not have been met. curl_easy_getinfo(3) with the
22 CURLINFO_CONDITION_UNMET option can be used after a transfer to learn
23 if a zero-byte successful "transfer" was due to this condition not
24 matching.
25
27 CURL_TIMECOND_NONE (0)
28
30 HTTP, FTP, RTSP, and FILE
31
33 CURL *curl = curl_easy_init();
34 if(curl) {
35 curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
36
37 /* January 1, 2020 is 1577833200 */
38 curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
39
40 /* If-Modified-Since the above time stamp */
41 curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
42
43 /* Perform the request */
44 curl_easy_perform(curl);
45 }
46
48 Always
49
51 Returns CURLE_OK
52
54 CURLOPT_TIMEVALUE(3),
55
56
57
58libcurl 7.69.1 April 03, 2016 CURLOPT_TIMECONDITION(3)