GNURLINFO_HEADER_SIZE(3)

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

πŸ’– NAME πŸ’–

okay so this is the page for GNURLINFO_HEADER_SIZE(3), and the manual name is curl_easy_getinfo options 🫢 The NAME itself is CURLINFO_HEADER_SIZE β€” get size of retrieved headers. Not me noticing the page header and the NAME don’t match exactly 😭 that’s just how it’s written, bestie πŸ’…


✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HEADER_SIZE, long
*sizep);

πŸ¦‹ DESCRIPTION πŸ¦‹

Pass a pointer to a long to receive the total size of all the headers received. Measured in number of bytes, no cap πŸ’–

The total includes the size of any received headers suppressed by CURLOPT_SUPPRESS_CONNECT_HEADERS(3). The way that detail matters is honestly iconic ✨


🌈 PROTOCOLS 🌈

All β€” every protocol, periodt πŸ’…


πŸŽ€ 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 size;
    res = curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &size);
    if(!res)
      printf("Header size: %ld bytes\n", size);
  }
  curl_easy_cleanup(curl);
}

🌸 AVAILABILITY 🌸

Added in 7.4.1 ⭐


πŸ‘‘ RETURN VALUE πŸ‘‘

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that, bestie 🫢


πŸ’œ SEE ALSO πŸ’œ


bye bestie! this page is from libcurl 7.44.0, dated 1 Sep 2015 πŸŽ€πŸ’–

πŸ“¦ where this page comes from