1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_HSTSWRITEDATA 5Section: 3 6Source: libcurl 7Protocol: 8 - HTTP 9See-also: 10 - CURLOPT_HSTS (3) 11 - CURLOPT_HSTSREADDATA (3) 12 - CURLOPT_HSTSREADFUNCTION (3) 13 - CURLOPT_HSTSWRITEFUNCTION (3) 14--- 15 16# NAME 17 18CURLOPT_HSTSWRITEDATA - pointer passed to the HSTS write callback 19 20# SYNOPSIS 21 22~~~c 23#include <curl/curl.h> 24 25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTSWRITEDATA, void *pointer); 26~~~ 27 28# DESCRIPTION 29 30Data *pointer* to pass to the HSTS write function. If you use the 31CURLOPT_HSTSWRITEFUNCTION(3) option, this is the pointer you get as 32input in the fourth argument to the callback. 33 34This option does not enable HSTS, you need to use CURLOPT_HSTS_CTRL(3) to 35do that. 36 37# DEFAULT 38 39NULL 40 41# EXAMPLE 42 43~~~c 44struct MyData { 45 void *custom; 46}; 47 48int main(void) 49{ 50 CURL *curl = curl_easy_init(); 51 struct MyData this; 52 if(curl) { 53 curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); 54 55 /* pass pointer that gets passed in to the 56 CURLOPT_HSTSWRITEFUNCTION callback */ 57 curl_easy_setopt(curl, CURLOPT_HSTSWRITEDATA, &this); 58 59 curl_easy_perform(curl); 60 } 61} 62~~~ 63 64# AVAILABILITY 65 66Added in 7.74.0 67 68# RETURN VALUE 69 70This returns CURLE_OK. 71