CURLOPT_HTTP_TRANSFER_DECODING.3 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_HTTP_TRANSFER_DECODING 3 "January 02, 2023" "libcurl 7.88.1" "curl_easy_setopt options"
  26. .SH NAME
  27. CURLOPT_HTTP_TRANSFER_DECODING \- HTTP transfer decoding control
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_TRANSFER_DECODING,
  32. long enabled);
  33. .SH DESCRIPTION
  34. Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
  35. transfer decoding will be disabled, if set to 1 it is enabled
  36. (default). libcurl does chunked transfer decoding by default unless this
  37. option is set to zero.
  38. .SH DEFAULT
  39. 1
  40. .SH PROTOCOLS
  41. HTTP
  42. .SH EXAMPLE
  43. .nf
  44. CURL *curl = curl_easy_init();
  45. if(curl) {
  46. CURLcode ret;
  47. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  48. curl_easy_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0L);
  49. ret = curl_easy_perform(curl);
  50. }
  51. .fi
  52. .SH AVAILABILITY
  53. Added in 7.16.2 Does not work with the hyper backend (it will always have
  54. transfer decoding enabled).
  55. .SH RETURN VALUE
  56. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  57. .SH "SEE ALSO"
  58. .BR CURLOPT_HTTP_CONTENT_DECODING "(3), " CURLOPT_ACCEPT_ENCODING "(3), "