CURLOPT_HTTP09_ALLOWED.3 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. .\" generated by cd2nroff 0.1 from CURLOPT_HTTP09_ALLOWED.md
  2. .TH CURLOPT_HTTP09_ALLOWED 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_HTTP09_ALLOWED \- allow HTTP/0.9 response
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP09_ALLOWED, long allowed);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass the long argument \fIallowed\fP set to 1L to allow HTTP/0.9 responses.
  12. An HTTP/0.9 response is a server response entirely without headers and only a
  13. body. You can connect to lots of random TCP services and still get a response
  14. that curl might consider to be HTTP/0.9!
  15. .SH DEFAULT
  16. 0
  17. .SH PROTOCOLS
  18. This functionality affects http only
  19. .SH EXAMPLE
  20. .nf
  21. int main(void)
  22. {
  23. CURL *curl = curl_easy_init();
  24. if(curl) {
  25. CURLcode ret;
  26. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  27. curl_easy_setopt(curl, CURLOPT_HTTP09_ALLOWED, 1L);
  28. ret = curl_easy_perform(curl);
  29. }
  30. }
  31. .fi
  32. .SH HISTORY
  33. curl allowed HTTP/0.9 responses by default before 7.66.0
  34. Since 7.66.0, libcurl requires this option set to 1L to allow HTTP/0.9
  35. responses.
  36. .SH AVAILABILITY
  37. Added in curl 7.64.0
  38. .SH RETURN VALUE
  39. Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
  40. .SH SEE ALSO
  41. .BR CURLOPT_HTTP_VERSION (3),
  42. .BR CURLOPT_SSLVERSION (3)