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