CURLOPT_HTTP_TRANSFER_DECODING.3 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. .\" generated by cd2nroff 0.1 from CURLOPT_HTTP_TRANSFER_DECODING.md
  2. .TH CURLOPT_HTTP_TRANSFER_DECODING 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_HTTP_TRANSFER_DECODING \- HTTP transfer decoding control
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_TRANSFER_DECODING,
  9. long enabled);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
  13. transfer decoding is disabled, if set to 1 it is enabled (default). libcurl
  14. does chunked transfer decoding by default unless this option is set to zero.
  15. .SH NOTES
  16. This option does not work with the hyper backend as that always has transfer
  17. decoding enabled.
  18. .SH DEFAULT
  19. 1
  20. .SH PROTOCOLS
  21. This functionality affects http only
  22. .SH EXAMPLE
  23. .nf
  24. int main(void)
  25. {
  26. CURL *curl = curl_easy_init();
  27. if(curl) {
  28. CURLcode ret;
  29. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  30. curl_easy_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0L);
  31. ret = curl_easy_perform(curl);
  32. }
  33. }
  34. .fi
  35. .SH AVAILABILITY
  36. Added in curl 7.16.2
  37. .SH RETURN VALUE
  38. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  39. .SH SEE ALSO
  40. .BR CURLOPT_ACCEPT_ENCODING (3),
  41. .BR CURLOPT_HTTP_CONTENT_DECODING (3)