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