1CURLINFO_CONDITION_UNMET(3)curl_easy_getinfo optionsCURLINFO_CONDITION_UNMET(3)
2
3
4

NAME

6       CURLINFO_CONDITION_UNMET  -  get  info on unmet time conditional or 304
7       HTTP response.
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONDITION_UNMET,
13                                  long *unmet);
14

DESCRIPTION

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

PROTOCOLS

26       HTTP and some
27

EXAMPLE

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, CURL_TIMECOND_IFMODSINCE);
38
39         /* Perform the request */
40         res = curl_easy_perform(curl);
41
42         if(!res) {
43           /* check the time condition */
44           long unmet;
45           res = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
46           if(!res) {
47             printf("The time condition was %sfulfilled\n", unmet?"NOT":"");
48           }
49         }
50       }
51

AVAILABILITY

53       Added in 7.19.4
54

RETURN VALUE

56       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
57       if not.
58

SEE ALSO

60       curl_easy_getinfo(3), curl_easy_setopt(3),
61
62
63
64libcurl 7.82.0                 November 26, 2021   CURLINFO_CONDITION_UNMET(3)
Impressum