GNURLOPT_HTTP_TRANSFER_DECODING(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay so this is the GNURLOPT_H...ER_DECODING(3) manual page, straight from the curl_easy_setopt options crew, and it's literally about CURLOPT_HTTP_TRANSFER_DECODING β€” the enable/disable HTTP transfer decoding option. Bestie, that's the whole assignment: turn HTTP transfer decoding on or off. πŸ’…

✨ SYNOPSIS ✨

Here's the exact spell, no cap:

       #include <gnurl/curl.h>

       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_TRANSFER_DECODING,
                                long enabled);

🌸 DESCRIPTION 🌸

You pass a long to tell libcurl how to act on transfer decoding. If set to zero, transfer decoding will be disabled, if set to 1 it is enabled (default). libcurl does chunked transfer decoding by default unless this option is set to zero. periodt ✨

πŸŽ€ DEFAULT πŸŽ€

1 β€” decoding is on by default. Slay. πŸ‘‘

πŸ¦‹ PROTOCOLS πŸ¦‹

HTTP β€” that's the protocol in the house. πŸ’…

πŸ“ EXAMPLE πŸ“

       CURL *curl = curl_easy_init();
       if(curl) {
         CURLcode ret;
         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
         curl_easy_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0L);
         ret = curl_easy_perform(curl);
       }

So here you init, set the URL, set transfer decoding to 0L, and perform. No extra steps, no drama. 🫢

⭐ AVAILABILITY ⭐

Added in 7.16.2 β€” vintage but still iconic. πŸŽ€

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. iykyk πŸ’–

🌈 SEE ALSO 🌈

Go give these a read, bestie: CURLOPT_HTTP_CONTENT_DECODING(3), CURLOPT_ACCEPT_ENCODING(3), β€” yes, the trailing comma is coming along too. 🫢


This lil page is from libcurl 7.37.0, dated 19 Jun 2014, with the manual name GNURLOPT_H...ER_DECODING(3) β€” bye bestie, go decode responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from