From: Daniel Stenberg Date: Tue, 25 Feb 2025 22:16:50 +0000 (+0100) Subject: CURLOPT_HTTPHEADER.md: add comments to the example X-Git-Tag: curl-8_13_0~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c81f2a35c9442158d69ea0b93010fc1d5aae5b6;p=thirdparty%2Fcurl.git CURLOPT_HTTPHEADER.md: add comments to the example Ref: https://mastodon.social/@jpmens/114065709635360064 Closes #16488 --- diff --git a/docs/libcurl/opts/CURLOPT_HTTPHEADER.md b/docs/libcurl/opts/CURLOPT_HTTPHEADER.md index 628e1dfedf..4440b4ec4b 100644 --- a/docs/libcurl/opts/CURLOPT_HTTPHEADER.md +++ b/docs/libcurl/opts/CURLOPT_HTTPHEADER.md @@ -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);