GNURLOPT_HTTP_TRANSFER_DECODING(3)
π 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
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms