GNURLOPT_HTTPGET(3)
π 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:0here has no effect. If you're trying to get back to the default method, the original page points you atcurl_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
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms