Sortix 1.1dev ports manual
This manual documents Sortix 1.1dev ports. You can instead view this document in the latest official manual.
CURLOPT_HEADEROPT(3) | curl_easy_setopt options | CURLOPT_HEADEROPT(3) |
NAME
CURLOPT_HEADEROPT - set how to send HTTP headersSYNOPSIS
#include <curl/curl.h>DESCRIPTION
Pass a long that is a bitmask of options of how to deal with headers. The two mutually exclusive options are:DEFAULT
CURLHEADER_SEPARATE (changed in 7.42.1, used CURLHEADER_UNIFIED before then)PROTOCOLS
HTTPEXAMPLE
CURL *curl = curl_easy_init(); if(curl) { CURLcode ret; struct curl_slist *list; list = curl_slist_append(NULL, "Shoesize: 10"); 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); }
AVAILABILITY
Added in 7.37.0RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.SEE ALSO
CURLOPT_HTTPHEADER(3), CURLOPT_PROXYHEADER(3),October 31, 2019 | libcurl 7.69.0 |