GNURLOPT_HTTP09_ALLOWED(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– GNURLOPT_HTTP09_ALLOWED(3) πŸ’–

okay so bestie, this is the GNURLOPT_HTTP09_ALLOWED(3) page from the curl_easy_setopt options manual, and it's literally all about letting HTTP/0.9 responses through. tiny option, big main-character energy πŸ’…βœ¨


πŸ“› NAME πŸ“›

CURLOPT_HTTP09 β€” allow HTTP/0.9 response. periodt. πŸ’–


🧚 SYNOPSIS 🧚

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP09_ALLOWED, long
allowed);

🌸 DESCRIPTION 🌸

Pass the long argument allowed set to 1L to allow HTTP/0.9 responses. yes, 1L specifically, bestie β€” not vibes, not 1, not "sure whatever" ✨

A HTTP/0.9 response is a server response entirely without headers and only a body. You can connect to lots of random TCP services and still get a response that curl might consider to be HTTP/0.9! not me side-eyeing every random TCP service πŸ™ˆπŸ’€


πŸŽ€ DEFAULT πŸŽ€

  • curl allowed HTTP/0.9 responses by default before 7.66.0
  • Since 7.66.0, libcurl requires this option set to 1L to allow HTTP/0.9 responses.

so yeah, the timeline matters here β€” before 7.66.0 it was chill by default, and since 7.66.0 you gotta opt in with 1L. 🫢


πŸ¦‹ PROTOCOLS πŸ¦‹

HTTP β€” that's the whole protocol list, iconic. πŸ”₯


⭐ EXAMPLE ⭐

CURL *curl = curl_easy_init();
if(curl) {
  CURLcode ret;
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  curl_easy_setopt(curl, CURLOPT_HTTP09_ALLOWED, 1L);
  ret = curl_easy_perform(curl);
}

🌈 AVAILABILITY 🌈

Option added in 7.64.0, present along with HTTP. slay. πŸ’–


πŸ‘‘ RETURN VALUE πŸ‘‘

Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. like, a clean little success/fail situation, no cap. ✨


πŸ”Ž SEE ALSO πŸ”Ž


and that's the page, bestie: libcurl 7.64.0, dated 17 Dec 2018, and the page name is GNURLOPT_HTTP09_ALLOWED(3) β€” bye, go allow those HTTP/0.9 responses responsibly πŸ«ΆπŸ’…πŸŽ€

πŸ“¦ where this page comes from