Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
CURLOPT_ACCEPT_ENCODING(3) | Library Functions Manual | CURLOPT_ACCEPT_ENCODING(3) |
NAME
CURLOPT_ACCEPT_ENCODING - automatic decompression of HTTP downloadsSYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ACCEPT_ENCODING, char *enc);
DESCRIPTION
Pass a char pointer argument specifying what encoding you would like.HISTORY
This option was called CURLOPT_ENCODING before 7.21.6NOTES
The specific libcurl you are using must have been built with zlib to be able to decompress gzip and deflate responses, with the brotli library to decompress brotli responses and with the zstd library to decompress zstd responses.DEFAULT
NULLPROTOCOLS
This functionality affects http onlyEXAMPLE
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* enable all supported built-in compressions */
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "");
/* Perform the request */
curl_easy_perform(curl);
}
}
AVAILABILITY
Added in curl 7.21.6RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.SEE ALSO
CURLOPT_HTTPHEADER(3), CURLOPT_HTTP_CONTENT_DECODING(3), CURLOPT_TRANSFER_ENCODING(3)2024-11-21 | libcurl |