GNURLOPT_HTTPGET(3)

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

πŸŽ€ NAME πŸŽ€

okay so this is GNURLOPT_HTTPGET(3) β€” the manual-name badge is right there, bestie β€” and the actual star is CURLOPT_HTTPGET: it means ask for an HTTP GET request. That's the whole name, no cap. πŸ’–

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTPGET, long useget);

πŸ’… DESCRIPTION πŸ’…

You pass a long, bestie. If useget is 1, this forces the HTTP request to get back to using GET. It's usable if a POST, HEAD, PUT, etc has been used previously using the same curl handle. Iconic method-reset behavior, fr fr. πŸ¦‹

When setting CURLOPT_HTTPGET(3) to 1, it will automatically set CURLOPT_NOBODY(3) to 0 and CURLOPT_UPLOAD(3) to 0. Like, it quietly fixes those little flags for you. 🫢

Setting this option to zero has no effect. Applications need to explicitly select which HTTP request method to use β€” they cannot deselect a method. To reset a handle to default method, consider curl_easy_reset(3). So zero is not a magic undo button, okay? πŸ™ˆ

🚨 vibe check: 0 here has no effect. If you're trying to get back to the default method, the original page points you at curl_easy_reset(3).

πŸ“ DEFAULT πŸ“

0

🌈 PROTOCOLS 🌈

HTTP(S)

πŸ”₯ EXAMPLE πŸ”₯

curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");

  /* use a GET to fetch this */
  curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);

  /* Perform the request */
  curl_easy_perform(curl);
}

πŸ‘‘ AVAILABILITY πŸ‘‘

Along with HTTP.

⭐ RETURN VALUE ⭐

Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ’Œ sign-off: this page comes from libcurl 7.37.0, dated 17 Jun 2014, and its manual-name badge is GNURLOPT_HTTPGET(3) β€” love u, bye bestie πŸ«ΆπŸ’…

πŸ“¦ where this page comes from