CURLINFO_REQUEST_SIZE(3)
π CURLINFO_REQUEST_SIZE π
okay so this is a page from the Library Functions Manual (libcurl girlies rise π«Ά) and it's all about CURLINFO_REQUEST_SIZE β the size of the request you sent out into the world β¨
πΈ NAME πΈ
CURLINFO_REQUEST_SIZE β literally just the size of the sent request, that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REQUEST_SIZE, long *sizep);
π DESCRIPTION π
bestie, here's the tea β β you pass in a pointer to a long, and it comes back stuffed with the total size of the issued requests. slay.
ngl this one is so far only for HTTP requests, so don't come for her about other protocols ok π
also heads up π β this may be more than one request if CURLOPT_FOLLOWLOCATION(3) is enabled. like she'll follow the redirects and the number just keeps growing, main character energy fr fr π₯
π¦ PROTOCOLS π¦
this functionality affects all supported protocols β every single one, no cap π
β EXAMPLE β
here's the whole thing, verbatim, copy-paste her and she'll eat π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
result = curl_easy_perform(curl);
if(result == CURLE_OK) {
long req;
result = curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &req);
if(!result)
printf("Request size: %ld bytes\n", req);
}
curl_easy_cleanup(curl);
}
}
π AVAILABILITY π
added in curl 7.4.1 β she's been iconic since day one, vintage queen π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error, bestie. that's the whole report card π
CURLE_OK(0) means everything was OK β we love a zero, we stan a zero β- non-zero means an error occurred π go check
libcurl-errors(3)for the full scoop
π₯ SEE ALSO π₯
go read them, iykyk πβ¨
ok that's the whole page diva, go measure some requests and be iconic about it π πΈ
and that's a wrap from libcurl, dated 2026-10-12 β mwah, drink some water, ily π«Άπ
π¦ 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