CURLOPT_HSTSWRITEDATA.3 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .\" generated by cd2nroff 0.1 from CURLOPT_HSTSWRITEDATA.md
  2. .TH CURLOPT_HSTSWRITEDATA 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_HSTSWRITEDATA \- pointer passed to the HSTS write callback
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTSWRITEDATA, void *pointer);
  9. .fi
  10. .SH DESCRIPTION
  11. Data \fIpointer\fP to pass to the HSTS write function. If you use the
  12. \fICURLOPT_HSTSWRITEFUNCTION(3)\fP option, this is the pointer you get as
  13. input in the fourth argument to the callback.
  14. This option does not enable HSTS, you need to use \fICURLOPT_HSTS_CTRL(3)\fP to
  15. do that.
  16. .SH DEFAULT
  17. NULL
  18. .SH PROTOCOLS
  19. This functionality affects http only
  20. .SH EXAMPLE
  21. .nf
  22. struct MyData {
  23. void *custom;
  24. };
  25. int main(void)
  26. {
  27. CURL *curl = curl_easy_init();
  28. struct MyData this;
  29. if(curl) {
  30. curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
  31. /* pass pointer that gets passed in to the
  32. CURLOPT_HSTSWRITEFUNCTION callback */
  33. curl_easy_setopt(curl, CURLOPT_HSTSWRITEDATA, &this);
  34. curl_easy_perform(curl);
  35. }
  36. }
  37. .fi
  38. .SH AVAILABILITY
  39. Added in curl 7.74.0
  40. .SH RETURN VALUE
  41. This returns CURLE_OK.
  42. .SH SEE ALSO
  43. .BR CURLOPT_HSTS (3),
  44. .BR CURLOPT_HSTSREADDATA (3),
  45. .BR CURLOPT_HSTSREADFUNCTION (3),
  46. .BR CURLOPT_HSTSWRITEFUNCTION (3)