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
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms