GNURLINFO_SIZE_UPLOAD_T(3)

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

πŸŽ€ GNURLINFO_SIZE_UPLOAD_T(3) πŸŽ€

okay bestie, welcome to the curl_easy_getinfo options manual β€” this page is all about grabbing the upload byte count, and yes, we are keeping every single detail πŸ’…βœ¨

✨ NAME ✨

CURLINFO_SIZE_UPLOAD_T β€” get the number of uploaded bytes 🫢

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SIZE_UPLOAD_T,
       curl_off_t *uploadp);

✨ DESCRIPTION ✨

Pass a pointer to a curl_off_t to receive the total amount of bytes that were uploaded. That's the whole vibe: you hand over the pointer, it hands back the number ✨.

🌈 PROTOCOLS 🌈

All β€” literally all of them, no cap.

🧚 EXAMPLE 🧚

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

  /* Perform the request */
  res = curl_easy_perform(curl);

  if(!res) {
    curl_off_t ul;
    res = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD_T, &ul);
    if(!res) {
      printf("Uploaded %" CURL_FORMAT_CURL_OFF_T " bytes\n", ul);
    }
  }
}

πŸ‘‘ AVAILABILITY πŸ‘‘

Added in 7.55.0 β€” vintage but still iconic πŸ’œ

πŸ’– RETURN VALUE πŸ’–

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. No drama, just those two.

🌸 SEE ALSO 🌸

and yes bestie, the original list has a trailing comma after CURLINFO_SIZE_UPLOAD(3) β€” iykyk πŸ’…


this page is libcurl 7.55.0, dated 25 May 2017 β€” bye bestie, go get those uploaded bytes πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from