1CURLINFO_CONDITION_UNMET(3)curl_easy_getinfo optionsCURLINFO_CONDITION_UNMET(3)
2
3
4
6 CURLINFO_CONDITION_UNMET - get info on unmet time conditional or 304
7 HTTP response.
8
10 #include <curl/curl.h>
11
12 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONDITION_UNMET,
13 long *unmet);
14
16 Pass a pointer to a long to receive the number 1 if the condition pro‐
17 vided in the previous request did not match (see CURLOPT_TIMECONDI‐
18 TION(3)). Alas, if this returns a 1 you know that the reason you did
19 not get data in return is because it did not fulfill the condition. The
20 long this argument points to will get a zero stored if the condition
21 instead was met. This can also return 1 if the server responded with a
22 304 HTTP status code, for example after sending a custom "If-Match-*"
23 header.
24
26 HTTP and some
27
29 CURL *curl = curl_easy_init();
30 if(curl) {
31 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
32
33 /* January 1, 2020 is 1577833200 */
34 curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
35
36 /* If-Modified-Since the above time stamp */
37 curl_easy_setopt(curl, CURLOPT_TIMECONDITION,
38 (long)CURL_TIMECOND_IFMODSINCE);
39
40 /* Perform the request */
41 res = curl_easy_perform(curl);
42
43 if(!res) {
44 /* check the time condition */
45 long unmet;
46 res = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
47 if(!res) {
48 printf("The time condition was %sfulfilled\n", unmet?"NOT":"");
49 }
50 }
51 }
52
54 Added in 7.19.4
55
57 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
58 if not.
59
61 curl_easy_getinfo(3), curl_easy_setopt(3),
62
63
64
65libcurl 8.0.1 January 02, 2023 CURLINFO_CONDITION_UNMET(3)