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