1CURLINFO_CONDITION_UNMET(3)curl_easy_getinfo optionsCURLINFO_CONDITION_UNMET(3)
2
3
4
6 CURLINFO_CONDITION_UNMET - get info on unmet time conditional
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONDITION_UNMET, long
12 *unmet);
13
15 Pass a pointer to a long to receive the number 1 if the condition pro‐
16 vided in the previous request didn't match (see CURLOPT_TIMECONDI‐
17 TION(3)). Alas, if this returns a 1 you know that the reason you didn't
18 get data in return is because it didn't fulfill the condition. The long
19 this argument points to will get a zero stored if the condition instead
20 was met.
21
23 HTTP and some
24
26 CURL *curl = curl_easy_init();
27 if(curl) {
28 curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
29
30 /* January 1, 2020 is 1577833200 */
31 curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
32
33 /* If-Modified-Since the above time stamp */
34 curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
35
36 /* Perform the request */
37 res = curl_easy_perform(curl);
38
39 if(!res) {
40 /* check the time condition */
41 long unmet;
42 res = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
43 if(!res) {
44 printf("The time condition was %sfulfilled\n", unmet?"NOT":"");
45 }
46 }
47 }
48
50 Added in 7.19.4
51
53 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
54 if not.
55
57 curl_easy_getinfo(3), curl_easy_setopt(3),
58
59
60
61libcurl 7.61.1 February 23, 2018 CURLINFO_CONDITION_UNMET(3)