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, long
13 *unmet);
14
16 Pass a pointer to a long to receive the number 1 if the condition pro‐
17 vided in the previous request didn't match (see CURLOPT_TIMECONDI‐
18 TION(3)). Alas, if this returns a 1 you know that the reason you didn't
19 get data in return is because it didn't fulfill the condition. The long
20 this argument points to will get a zero stored if the condition instead
21 was met. This can also return 1 if the server responded with a 304 HTTP
22 status code, for example after sending a custom "If-Match-*" header.
23
25 HTTP and some
26
28 CURL *curl = curl_easy_init();
29 if(curl) {
30 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
31
32 /* January 1, 2020 is 1577833200 */
33 curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
34
35 /* If-Modified-Since the above time stamp */
36 curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
37
38 /* Perform the request */
39 res = curl_easy_perform(curl);
40
41 if(!res) {
42 /* check the time condition */
43 long unmet;
44 res = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
45 if(!res) {
46 printf("The time condition was %sfulfilled\n", unmet?"NOT":"");
47 }
48 }
49 }
50
52 Added in 7.19.4
53
55 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
56 if not.
57
59 curl_easy_getinfo(3), curl_easy_setopt(3),
60
61
62
63libcurl 7.79.1 November 04, 2020 CURLINFO_CONDITION_UNMET(3)