1CURLINFO_REQUEST_SIZE(3) libcurl CURLINFO_REQUEST_SIZE(3)
2
3
4
6 CURLINFO_REQUEST_SIZE - get size of sent request
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REQUEST_SIZE, long *sizep);
12
14 Pass a pointer to a long to receive the total size of the issued re‐
15 quests. This is so far only for HTTP requests. Note that this may be
16 more than one request if CURLOPT_FOLLOWLOCATION(3) is enabled.
17
19 All
20
22 CURL *curl = curl_easy_init();
23 if(curl) {
24 CURLcode res;
25 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
26 res = curl_easy_perform(curl);
27 if(res == CURLE_OK) {
28 long req;
29 res = curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &req);
30 if(!res)
31 printf("Request size: %ld bytes\n", req);
32 }
33 curl_easy_cleanup(curl);
34 }
35
37 Added in 7.4.1
38
40 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
41 if not.
42
44 curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_HEADER_SIZE(3),
45 CURLINFO_SIZE_DOWNLOAD(3),
46
47
48
49ibcurl 8.2.1 April 26, 2023 CURLINFO_REQUEST_SIZE(3)