CURLINFO_SPEED_UPLOAD(3)

✨ NAME ✨

CURLINFO_SPEED_UPLOAD β€” upload speed. That's the name section, bestie. And yes, this is the CURLINFO_SPEED_UPLOAD(3) page from the Library Functions Manual β€” we're doing this. πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

#include <curl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD, double *speed);

πŸ’– DESCRIPTION πŸ’–

Okay so you pass a pointer to a double to receive the average upload speed that curl measured for the complete upload. It's measured in bytes/second. Slay. πŸ’…

And listen: CURLINFO_SPEED_UPLOAD_T(3) is a newer replacement that returns a more sensible variable type. So that's the newer-glow-up option, iykyk. ✨

🌈 PROTOCOLS 🌈

This functionality affects all supported protocols. All of them. No cap. πŸ¦‹

🧚 EXAMPLE 🧚

Here's the example in all its glory:

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) {
      double speed;
      result = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed);
      if(!result) {
        printf("Upload speed %.0f bytes/sec\n", speed);
      }
    }
  }
}

πŸ’€ DEPRECATED πŸ’€

⚠️ Deprecated since 7.55.0. That's the whole deprecation notice, bestie β€” it's giving "old but still in the manual." πŸ’€

πŸ¦‹ AVAILABILITY πŸ¦‹

Added in curl 7.4.1. Cute. ✨

⭐ 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). πŸ’…

πŸ“ SEE ALSO πŸ“


xoxo, your libcurl bestie πŸ’– β€” source/version: libcurl; date: 2026-10-12; page: CURLINFO_SPEED_UPLOAD(3). 🫢

πŸ“¦ where this page comes from