GNURLOPT_H...T_DECODING(3)
π GNURLOPT_H...T_DECODING(3) π
okay so bestie, welcome to the curl_easy_setopt options corner of the gnurl manual β this one's about content decoding and it's honestly shorter than my attention span, so let's go β¨
π NAME π
CURLOPT_HTTP_CONTENT_DECODING β the little switch that turns HTTP content decoding on or off. yes queen, that's literally it π«Ά
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_CONTENT_DECODING,
long enabled);
πΈ DESCRIPTION πΈ
so you pass a long in there and it tells libcurl how to act on content decoding. the vibes are:
- set it to zero β‘οΈ content decoding gets disabled, bye π
- set it to 1 β‘οΈ content decoding is enabled, slay π
β οΈ and this is the important part, bestie: libcurl has no default content decoding on its own β it literally requires you to use CURLOPT_ACCEPT_ENCODING(3) for that. so don't come for libcurl asking why nothing's being decoded when you never told it anything. iykyk π
π¦ DEFAULT π¦
1
(not her being on by default and still needing CURLOPT_ACCEPT_ENCODING(3) β the audacity, honestly π₯)
π PROTOCOLS π
HTTP
that's the whole list. one protocol. main character energy π
π 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_CONTENT_DECODING, 0L);
ret = curl_easy_perform(curl);
}
see how she passes 0L? that's decoding off, bestie. ate and left no crumbs π
β AVAILABILITY β
added in 7.16.2 β a whole elder, lowkey iconic for it π§
π RETURN VALUE π
- returns
CURLE_OKif the option is supported π - returns
CURLE_UNKNOWN_OPTIONif it's not π
no in-between, no drama.
π SEE ALSO π
and that's the whole page, bestie!! mwah π this lil slice of the gnurl world is brought to you by libcurl 7.37.0, dated 19 Jun 2014 β yes she's vintage, and yes she still serves π«Άβ¨
π¦ 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