CURLOPT_HTTP_CONTENT_DECODING.md (1270B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_HTTP_CONTENT_DECODING 5 Section: 3 6 Source: libcurl 7 Protocol: 8 - HTTP 9 See-also: 10 - CURLOPT_ACCEPT_ENCODING (3) 11 - CURLOPT_DEBUGFUNCTION (3) 12 - CURLOPT_STDERR (3) 13 Added-in: 7.16.2 14 --- 15 16 # NAME 17 18 CURLOPT_HTTP_CONTENT_DECODING - HTTP content decoding control 19 20 # SYNOPSIS 21 22 ~~~c 23 #include <curl/curl.h> 24 25 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_CONTENT_DECODING, 26 long enabled); 27 ~~~ 28 29 # DESCRIPTION 30 31 Pass a long to tell libcurl how to act on content decoding. If set to zero, 32 content decoding is disabled. If set to 1 it is enabled. libcurl has no 33 default content decoding but requires you to use 34 CURLOPT_ACCEPT_ENCODING(3) for that. 35 36 # DEFAULT 37 38 1 39 40 # %PROTOCOLS% 41 42 # EXAMPLE 43 44 ~~~c 45 int main(void) 46 { 47 CURL *curl = curl_easy_init(); 48 if(curl) { 49 CURLcode ret; 50 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); 51 curl_easy_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 0L); 52 ret = curl_easy_perform(curl); 53 } 54 } 55 ~~~ 56 57 # %AVAILABILITY% 58 59 # RETURN VALUE 60 61 curl_easy_setopt(3) returns a CURLcode indicating success or error. 62 63 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 64 libcurl-errors(3).