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)
12---
13
14# NAME
15
16CURLOPT_HTTP_TRANSFER_DECODING - HTTP transfer decoding control
17
18# SYNOPSIS
19
20~~~c
21#include <curl/curl.h>
22
23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_TRANSFER_DECODING,
24                         long enabled);
25~~~
26
27# DESCRIPTION
28
29Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
30transfer decoding is disabled, if set to 1 it is enabled (default). libcurl
31does chunked transfer decoding by default unless this option is set to zero.
32
33# DEFAULT
34
351
36
37# EXAMPLE
38
39~~~c
40int main(void)
41{
42  CURL *curl = curl_easy_init();
43  if(curl) {
44    CURLcode ret;
45    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
46    curl_easy_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0L);
47    ret = curl_easy_perform(curl);
48  }
49}
50~~~
51
52# AVAILABILITY
53
54Added in 7.16.2 Does not work with the hyper backend (it always has transfer
55decoding enabled).
56
57# RETURN VALUE
58
59Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
60