1CURLINFO_HEADER_SIZE(3)    curl_easy_getinfo options   CURLINFO_HEADER_SIZE(3)
2
3
4

NAME

6       CURLINFO_HEADER_SIZE - get size of retrieved headers
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HEADER_SIZE, long *sizep);
12

DESCRIPTION

14       Pass  a  pointer to a long to receive the total size of all the headers
15       received. Measured in number of bytes.
16
17       The total includes the size of any received headers suppressed by  CUR‐
18       LOPT_SUPPRESS_CONNECT_HEADERS(3).
19

PROTOCOLS

21       All
22

EXAMPLE

24       CURL *curl = curl_easy_init();
25       if(curl) {
26         CURLcode res;
27         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
28         res = curl_easy_perform(curl);
29         if(res == CURLE_OK) {
30           long size;
31           res = curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &size);
32           if(!res)
33             printf("Header size: %ld bytes\n", size);
34         }
35         curl_easy_cleanup(curl);
36       }
37

AVAILABILITY

39       Added in 7.4.1
40

RETURN VALUE

42       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
43       if not.
44

SEE ALSO

46       curl_easy_getinfo(3),  curl_easy_setopt(3),   CURLINFO_REQUEST_SIZE(3),
47       CURLINFO_SIZE_DOWNLOAD(3),
48
49
50
51libcurl 7.82.0                 November 26, 2021       CURLINFO_HEADER_SIZE(3)
Impressum