]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT_HTTPHEADER.md: add comments to the example
authorDaniel Stenberg <daniel@haxx.se>
Tue, 25 Feb 2025 22:16:50 +0000 (23:16 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 25 Feb 2025 22:56:05 +0000 (23:56 +0100)
Ref: https://mastodon.social/@jpmens/114065709635360064
Closes #16488

docs/libcurl/opts/CURLOPT_HTTPHEADER.md

index 628e1dfedf363763208c7565761d9a44024b3819..4440b4ec4b61492da5de45f7fe08ade8be635547 100644 (file)
@@ -167,9 +167,15 @@ int main(void)
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
 
+    /* add this header */
     list = curl_slist_append(list, "Shoesize: 10");
+
+    /* remove this header */
     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_perform(curl);