GNURLINFO_HTTP_VERSION(3)
π GNURLINFO_HTTP_VERSION(3) π
πΈ NAME πΈ
CURLINFO_HTTP_VERSION β get the http version used in the connection.
okay so this page lives in the curl_easy_getinfo options manual, and itβs literally your little vibe check for which http version showed up. no cap.
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HTTP_VERSION, long
*p);
π¦ DESCRIPTION π¦
You pass in a pointer to a long, bestie, and it receives the version used in the last http connection. The returned value will be CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_1_1, CURL_HTTP_VERSION_2_0, CURL_HTTP_VERSION_3 or 0 if the version canβt be determined.
like, thatβs the whole tea. π
π PROTOCOLS π
HTTP
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
res = curl_easy_perform(curl);
if(res == CURLE_OK) {
long http_version;
curl_easy_getinfo(curl, CURLINFO_HTTP_VERSION, &http_version);
}
curl_easy_cleanup(curl);
}
π AVAILABILITY π
Added in 7.50.0.
π₯ RETURN VALUE π₯
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
π«Ά SEE ALSO π«Ά
xoxo, bestie π source/version: libcurl 7.50.0; date: 11 May 2016; page: GNURLINFO_HTTP_VERSION(3). slay and goodbye π«Ά
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, 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