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# DEFAULT
35
361
37
38# %PROTOCOLS%
39
40# EXAMPLE
41
42~~~c
43int main(void)
44{
45  CURL *curl = curl_easy_init();
46  if(curl) {
47    CURLcode ret;
48    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
49    curl_easy_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0L);
50    ret = curl_easy_perform(curl);
51  }
52}
53~~~
54
55# %AVAILABILITY%
56
57# RETURN VALUE
58
59Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
60