CURLOPT_HTTPHEADER.md: add comments to the example
Ref: https://mastodon.social/@jpmens/114065709635360064 Closes #16488
This commit is contained in:
parent
baa9c647d3
commit
6c81f2a35c
@ -167,9 +167,15 @@ int main(void)
|
|||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||||
|
|
||||||
|
/* add this header */
|
||||||
list = curl_slist_append(list, "Shoesize: 10");
|
list = curl_slist_append(list, "Shoesize: 10");
|
||||||
|
|
||||||
|
/* remove this header */
|
||||||
list = curl_slist_append(list, "Accept:");
|
list = curl_slist_append(list, "Accept:");
|
||||||
|
|
||||||
|
/* change this header */
|
||||||
|
list = curl_slist_append(list, "Host: example.net");
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
|
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
|
||||||
|
|
||||||
curl_easy_perform(curl);
|
curl_easy_perform(curl);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user