CURLOPT_PASSWORD.3 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PASSWORD.md
  2. .TH CURLOPT_PASSWORD 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PASSWORD \- password to use in authentication
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PASSWORD, char *pwd);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a char pointer as parameter, which should be pointing to the
  12. null\-terminated password to use for the transfer.
  13. The \fICURLOPT_PASSWORD(3)\fP option should be used in conjunction with the
  14. \fICURLOPT_USERNAME(3)\fP option.
  15. The application does not have to keep the string around after setting this
  16. option.
  17. .SH DEFAULT
  18. blank
  19. .SH PROTOCOLS
  20. This functionality affects all supported protocols
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. CURL *curl = curl_easy_init();
  26. if(curl) {
  27. CURLcode res;
  28. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
  29. curl_easy_setopt(curl, CURLOPT_PASSWORD, "qwerty");
  30. res = curl_easy_perform(curl);
  31. curl_easy_cleanup(curl);
  32. }
  33. }
  34. .fi
  35. .SH AVAILABILITY
  36. Added in curl 7.19.1
  37. .SH RETURN VALUE
  38. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  39. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  40. .SH SEE ALSO
  41. .BR CURLOPT_HTTPAUTH (3),
  42. .BR CURLOPT_PROXYAUTH (3),
  43. .BR CURLOPT_USERNAME (3),
  44. .BR CURLOPT_USERPWD (3)