GNURLINFO...TION_UNMET(3)
okay so bestie, welcome to the GNURLINFO...TION_UNMET(3) page β it's filed under the curl_easy_getinfo options manual, and it's all about CURLINFO_CONDITION_UNMET. no cap, the manual name is literally that truncated-lookin' string. π
π NAME π
CURLINFO_CONDITION_UNMET β get info on unmet time conditional or 304 HTTP response. That's the whole vibe: it tells you when a conditional request didn't hand over the goods. π¦
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONDITION_UNMET, long
*unmet);
π DESCRIPTION π
So here's the tea: you pass a pointer to a long to receive the number 1 if the condition provided in the previous request didn't match (see CURLOPT_TIMECONDITION(3)). Periodt. π
Alas, if this returns a 1, you know that the reason you didn't get data in return is because it didn't fulfill the condition. The long this argument points to will get a zero stored if the condition instead was met. π
This can also return 1 if the server responded with a 304 HTTP status code β for example after sending a custom "If-Match-*" header. Highkey iconic. π₯
π PROTOCOLS π
HTTP and some. Yep, βsomeβ is literally what it says β I'm not making it up. π
π§ EXAMPLE π§
Here's the example, exact and ready to copy-paste, bestie:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* January 1, 2020 is 1577833200 */
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
/* If-Modified-Since the above time stamp */
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
/* Perform the request */
res = curl_easy_perform(curl);
if(!res) {
/* check the time condition */
long unmet;
res = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
if(!res) {
printf("The time condition was %sfulfilled\n", unmet?"NOT":"");
}
}
}
That's the example as the page lays it out. π
π¦ AVAILABILITY π¦
Added in 7.19.4. She's been around. π
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that. β¨
π SEE ALSO π
The friends of this page:
From libcurl 7.44.0, dated 1 Sep 2015 β mwah, go forth and conditional-request, bestie. πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms