summaryrefslogtreecommitdiff
path: root/docs/libcurl/opts/GNURLOPT_HEADEROPT.3
diff options
context:
space:
mode:
Diffstat (limited to 'docs/libcurl/opts/GNURLOPT_HEADEROPT.3')
-rw-r--r--docs/libcurl/opts/GNURLOPT_HEADEROPT.32
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/libcurl/opts/GNURLOPT_HEADEROPT.3 b/docs/libcurl/opts/GNURLOPT_HEADEROPT.3
index 643f92ed5..eaea05dff 100644
--- a/docs/libcurl/opts/GNURLOPT_HEADEROPT.3
+++ b/docs/libcurl/opts/GNURLOPT_HEADEROPT.3
@@ -57,12 +57,14 @@ if(curl) {
list = curl_slist_append(list, "Accept:");
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
+ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
/* HTTPS over a proxy makes a separate CONNECT to the proxy, so tell
libcurl to not send the custom headers to the proxy. Keep them
separate! */
curl_easy_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE);
ret = curl_easy_perform(curl);
+ curl_slist_free_all(list);
curl_easy_cleanup(curl);
}
.fi