CURLINFO_SPEED_UPLOAD_T(3)

okay so bestie, welcome to the CURLINFO_SPEED_UPLOAD_T(3) page from the Library Functions Manual β€” it's literally all about getting that upload speed tea β˜•βœ¨


πŸŽ€ NAME πŸŽ€

CURLINFO_SPEED_UPLOAD_T β€” upload speed, bestie πŸ’…


✨ SYNOPSIS ✨

#include <curl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD_T,
                           curl_off_t *speed);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: you pass a pointer to a curl_off_t, and it receives the average upload speed that curl measured for the complete upload. The unit is bytes/second. No cap, that's the whole thing 🫢

reminder: it's the average for the complete upload, not some live speedometer situation.

🌈 PROTOCOLS 🌈

This functionality affects all supported protocols β€” it's not picky, it's giving universal icon energy πŸ‘‘


πŸ“ EXAMPLE πŸ“

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");

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

    if(!result) {
      curl_off_t speed;
      result = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD_T, &speed);
      if(!result) {
        printf("Upload speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\n", speed);
      }
    }
  }
}

⭐ AVAILABILITY ⭐

Added in curl 7.55.0 β€” vintage-ish but still slaying πŸ’–


πŸ”₯ RETURN VALUE πŸ”₯

curl_easy_getinfo(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK. Non-zero means an error occurred β€” see libcurl-errors(3) for the full drama 😭


πŸ‘‘ SEE ALSO πŸ‘‘


k bye bestie! 🫢 this page is from libcurl, stamped 2026-10-12, and yes it's the CURLINFO_SPEED_UPLOAD_T(3) manual page β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from