GNURLOPT_PASSWORD(3)
π GNURLOPT_PASSWORD π
okay bestie, so this page lives in the gnurl part of the manual (section 3, the function-call girlies), and it's literally just about one thing: the password you hand over when you need to authenticate a transfer. let's get into it π«Ά
β¨ NAME β¨
CURLOPT_PASSWORD β the password you use in authentication π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PASSWORD, char *pwd);
β¨ DESCRIPTION β¨
so you pass a char * as the parameter, and it should be pointing at the null-terminated password you wanna use for the transfer. that's it. that's the whole vibe. π
the CURLOPT_PASSWORD(3) option is meant to be used in conjunction with the CURLOPT_USERNAME(3) option β they're a matching set, like a friendship bracelet situation. no cap. π
and the best part? the application does not have to keep the string around after setting this option. so you can let it go, it's fine, it's handled. π
β¨ DEFAULT β¨
blank π«₯
β¨ PROTOCOLS β¨
Most π
β¨ EXAMPLE β¨
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_PASSWORD, "qwerty");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
(and yes, "qwerty" is in the official docs, not me β iconic of them honestly π)
β¨ AVAILABILITY β¨
added in 7.19.1 β
β¨ RETURN VALUE β¨
it returns CURLE_OK if the option is supported (slay), CURLE_UNKNOWN_OPTION if it's not supported (sad but valid), or CURLE_OUT_OF_MEMORY if there wasn't enough heap space (the struggle π).
β¨ SEE ALSO β¨
go read those next, i promise they're relevant π
mwah, that's the whole page! this one's from libcurl 7.37.0, dated 19 Jun 2014 β a little vintage moment, we love a classic π¦πΈπ
π¦ 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