GNURLINFO_RETRY_AFTER(3)
π
GNURLINFO_RETRY_AFTER(3) β the curl_easy_getinfo options era π
okay so bestie, this page is from the curl_easy_getinfo options manual, and it's literally about one very specific little getinfo vibe: CURLINFO_RETRY_AFTER π no cap, it's giving "how long should I wait before trying again?"
β¨ NAME β¨
CURLINFO_RETRY_AFTER β returns the Retry-After retry delay π
π¦ SYNOPSIS π¦
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RETRY_AFTER,
curl_off_t *retry);
πΈ DESCRIPTION πΈ
You pass a pointer to a curl_off_t variable, and it receives the number of seconds the HTTP server suggesets (their spelling, not mine π) the client should wait until the next request is issued. It's the info from the Retry-After: header, periodt.
And here's the lowkey iconic part: even though the HTTP header might contain a fixed date string, CURLINFO_RETRY_AFTER(3) will always return the number of seconds to wait β or zero if there was no header or the header couldn't be parsed. Zero. Zilch. The void. π
π DEFAULT π
Returns zero delay if there was no header. That's it, that's the default vibe β¨
π PROTOCOLS π
HTTP(S) β that's the whole menu, bestie π
π₯ EXAMPLE π₯
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
res = curl_easy_perform(curl);
if(res == CURLE_OK) {
curl_off_t wait = 0;
curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &wait);
if(wait)
printf("Wait for %" CURL_FORMAT_CURL_OFF_T " seconds\n", wait);
}
curl_easy_cleanup(curl);
}
β AVAILABILITY β
Added in curl 7.66.0 β a whole era π
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Translation: supported = slay, unsupported = unknown option energy π
π«Ά SEE ALSO π«Ά
Go read those too, they're part of the lore π§
okay that's the whole page, bestie π«Άπ β source/version is libcurl 7.66.0, dated 6 Aug 2019, and the page title is GNURLINFO_RETRY_AFTER(3) β¨
π¦ 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