1CURLOPT_TIMECONDITION(3)   curl_easy_setopt options   CURLOPT_TIMECONDITION(3)
2
3
4

NAME

6       CURLOPT_TIMECONDITION - select condition for a time request
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_setopt(CURL  *handle,  CURLOPT_TIMECONDITION,  long
12       cond);
13

DESCRIPTION

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_TIMECOND_IF‐
17       MODSINCE 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

DEFAULT

27       CURL_TIMECOND_NONE (0)
28

PROTOCOLS

30       HTTP, FTP, RTSP, and FILE
31

EXAMPLE

33       CURL *curl = curl_easy_init();
34       if(curl) {
35         curl_easy_setopt(curl, CURLOPT_URL, "https://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

AVAILABILITY

48       Always
49

RETURN VALUE

51       Returns CURLE_OK
52

SEE ALSO

54       CURLOPT_TIMEVALUE(3),
55
56
57
58libcurl 7.76.1                 November 04, 2020      CURLOPT_TIMECONDITION(3)
Impressum