GNURLOPT_REFERER(3)
π GNURLOPT_REFERER(3) π
okay bestie, this is the gnurl manual page for GNURLOPT_REFERER(3) β aka the curl_easy_setopt options corner. it's giving βset the HTTP referer headerβ energy, and yes we're keeping every fact. π
β¨ NAME β¨
CURLOPT_REFERER β set the HTTP referer header. no cap, that's literally the whole name. π¦
πΈ SYNOPSIS πΈ
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_REFERER, char *where);
π DESCRIPTION π
Pass a pointer to a null-terminated string as parameter. that string gets used to set the Referer: header in the http request sent to the remote server. yes really β this can be used to fool servers or scripts. π
you can also set any custom header with CURLOPT_HTTPHEADER(3), bestie. and good news: the application does not have to keep the string around after setting this option. so no need to clutch that buffer forever. π«Ά
π DEFAULT π
NULL β that's the default. slay. π
π PROTOCOLS π
HTTP β that's the protocol in the house. β¨
π§ EXAMPLE π§
okay so here's the whole vibe in code, exactly as it goes:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* tell it where we found the link to this place */
curl_easy_setopt(curl, CURLOPT_REFERER, "http://example.com/aboutme.html");
curl_easy_perform(curl);
}
π AVAILABILITY π
if built with HTTP support. that's the whole condition, periodt. π
β RETURN VALUE β
Returns CURLE_OK if HTTP support is enabled, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. those are the three return values, bestie β no extras. π«Ά
π¦ SEE ALSO π¦
mwah π this page is from libcurl 7.37.0, dated 17 Jun 2014 β gnurl manual realness, signed off with sparkle. πβ¨
π¦ 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