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)
13Added-in: 7.16.2
14---
15
16# NAME
17
18CURLOPT_HTTP_CONTENT_DECODING - HTTP content decoding control
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_CONTENT_DECODING,
26                          long enabled);
27~~~
28
29# DESCRIPTION
30
31Pass a long to tell libcurl how to act on content decoding. If set to zero,
32content decoding is disabled. If set to 1 it is enabled. Libcurl has no
33default content decoding but requires you to use
34CURLOPT_ACCEPT_ENCODING(3) for that.
35
36# DEFAULT
37
381
39
40# %PROTOCOLS%
41
42# EXAMPLE
43
44~~~c
45int 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
61Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
62