GNURLINFO_REQUEST_SIZE(3)

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

πŸŽ€ GNURLINFO_REQUEST_SIZE(3): get size of sent request πŸŽ€

okay so bestie, this page is GNURLINFO_REQUEST_SIZE(3) from the curl_easy_getinfo options manual, and it's literally all about asking β€œhow big was the request we sent?” ✨ no cap.

🌸 NAME 🌸

CURLINFO_REQUEST_SIZE β€” get size of sent request πŸ’–

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

You pass in a pointer to a long, and it receives the total size of the issued requests. So far, this is only for HTTP requests β€” that's the vibe check on it. πŸ‘‘

Also highkey note: this may be more than one request if CURLOPT_FOLLOWLOCATION(3) is enabled. Like, the total can cover multiple requests in that case, periodt. πŸ’…

🌈 PROTOCOLS 🌈

All β€” every protocol, no cap. ⭐

🧚 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 req;
    res = curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &req);
    if(!res)
      printf("Request size: %ld bytes\n", req);
  }
  curl_easy_cleanup(curl);
}

πŸ’œ AVAILABILITY πŸ’œ

Added in 7.4.1 β€” iconic since day one. 🫢

πŸ”₯ RETURN VALUE πŸ”₯

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. That's the whole mood. πŸ’€

πŸ“ SEE ALSO πŸ“


mwah πŸ’‹βœ¨ cute little sign-off: this page is from libcurl 7.44.0, dated 1 Sep 2015, and it ate. πŸŽ€πŸ‘‘

πŸ“¦ where this page comes from