GNURLOPT_AUTOREFERER(3)
GNURLOPT_AUTOREFERER(3) π
okay so bestie, this page lives in the curl_easy_setopt options manual, and it's literally here to explain the auto-referer glow-up. No cap. β¨
β¨ NAME β¨
CURLOPT_AUTOREFERERβ automatically update the referer header
π¦ SYNOPSIS π¦
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_AUTOREFERER, long
autorefer);
πΈ DESCRIPTION πΈ
Pass a parameter set to 1 to enable this. When it's enabled, libcurl will automatically set the Referer: header field in HTTP requests where it follows a Location: redirect. It's giving self-updating header energy. π«
π DEFAULT π
0, disabled β so it's off by default, bestie. π
π₯ PROTOCOLS π₯
HTTP. Periodt. π
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
/* follow redirects */
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
/* set Referer: automatically when following redirects */
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
β AVAILABILITY β
Along with HTTP. π«Ά
π RETURN VALUE π
Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. π―
π«Ά SEE ALSO π«Ά
Also go peek at CURLOPT_REFERER(3), CURLOPT_FOLLOWLOCATION(3), β bestie homework. π
mwah π β this page is from libcurl 7.37.0, dated 17 Jun 2014. slay. π
π¦ 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