GNURLINFO_...RECT_COUNT(3)
π GNURLINFO_...RECT_COUNT(3) π
okay bestie, this is a page from the curl_easy_getinfo options manual, and it's all about counting redirects. slay. π
β¨ NAME β¨
CURLINFO_REDIRECT_COUNT β get the number of redirects π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_COUNT, long *countp);
β¨ DESCRIPTION β¨
You pass in a pointer to a long, and it receives the total number of redirections that were actually followed. no cap, that's the whole vibe check. π
β¨ PROTOCOLS β¨
HTTP(S) β that's it, that's the list. π
β¨ EXAMPLE β¨
here's the little demo, copied exactly so you can run it and feel iconic:
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
res = curl_easy_perform(curl);
if(res == CURLE_OK) {
long redirects;
curl_easy_getinfo(curl, CURLINFO_REDIRECT_COUNT, &redirects);
}
curl_easy_cleanup(curl);
}
β¨ AVAILABILITY β¨
Added in 7.9.7 β she's been around for a minute, fr fr. β
β¨ RETURN VALUE β¨
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. simple as that, bestie. π
β¨ SEE ALSO β¨
stay slay, bestie π β this page comes from libcurl 7.44.0, dated 28 Aug 2015, and its header/footer home is GNURLINFO_...RECT_COUNT(3). π«Άπ
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, 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