4
<!-- Manpage converted by man2html 3.0.1 -->
8
curl_easy_getinfo - Extract information from a curl session
13
<H2>SYNOPSIS</H2><PRE>
14
<B>#include</B> <B><curl/curl.h></B>
16
<B>CURLcode</B> <B>curl_easy_getinfo(CURL</B> <B>*curl,</B> <B>CURLINFO</B> <B>info,</B> <B>...</B> <B>);</B>
20
<H2>DESCRIPTION</H2><PRE>
21
Request internal information from the curl session with this
22
function. The third argument <B>MUST</B> be a pointer to a long, a
23
pointer to a char * or a pointer to a double (as this docu�
24
mentation describes further down). The data pointed-to will
25
be filled in accordingly and can be relied upon only if the
26
function returns CURLE_OK. This function is intended to get
27
used *AFTER* a performed transfer, all results from this
28
function are undefined until the transfer is completed.
32
<H2>AVAILABLE INFORMATION</H2><PRE>
33
These are informations that can be extracted:
35
<B>CURLINFO_EFFECTIVE_URL</B>
36
Pass a pointer to a 'char *' to receive the last
39
<B>CURLINFO_HTTP_CODE</B>
40
Pass a pointer to a long to receive the last
43
<B>CURLINFO_FILETIME</B>
44
Pass a pointer to a long to receive the remote time
45
of the retrieved document. If you get -1, it can be
46
because of many reasons (unknown, the server hides
47
it or the server doesn't support the command that
48
tells document time etc) and the time of the docu�
49
ment is unknown. Note that you must tell the server
50
to collect this information before the transfer is
51
made, by using the CURLOPT_FILETIME option to
52
<I>curl</I><B>_</B><I>easy</I><B>_</B><I>setopt(3)</I>. (Added in 7.5)
54
<B>CURLINFO_TOTAL_TIME</B>
55
Pass a pointer to a double to receive the total
56
transaction time in seconds for the previous trans�
59
<B>CURLINFO_NAMELOOKUP_TIME</B>
60
Pass a pointer to a double to receive the time, in
61
seconds, it took from the start until the name
62
resolving was completed.
64
<B>CURLINFO_CONNECT_TIME</B>
65
Pass a pointer to a double to receive the time, in
66
seconds, it took from the start until the connect to
67
the remote host (or proxy) was completed.
69
<B>CURLINFO_PRETRANSFER_TIME</B>
70
Pass a pointer to a double to receive the time, in
71
seconds, it took from the start until the file
72
transfer is just about to begin. This includes all
73
pre-transfer commands and negotiations that are spe�
74
cific to the particular protocol(s) involved.
76
<B>CURLINFO_STARTTRANSFER_TIME</B>
77
Pass a pointer to a double to receive the time, in
78
seconds, it took from the start until the first byte
79
is just about to be transfered. This includes
80
CURLINFO_PRETRANSFER_TIME and also the time the
81
server needs to calculate the result.
83
<B>CURLINFO_SIZE_UPLOAD</B>
84
Pass a pointer to a double to receive the total
85
amount of bytes that were uploaded.
87
<B>CURLINFO_SIZE_DOWNLOAD</B>
88
Pass a pointer to a double to receive the total
89
amount of bytes that were downloaded.
91
<B>CURLINFO_SPEED_DOWNLOAD</B>
92
Pass a pointer to a double to receive the average
93
download speed that curl measured for the complete
96
<B>CURLINFO_SPEED_UPLOAD</B>
97
Pass a pointer to a double to receive the average
98
upload speed that curl measured for the complete
101
<B>CURLINFO_HEADER_SIZE</B>
102
Pass a pointer to a long to receive the total size
103
of all the headers received.
105
<B>CURLINFO_REQUEST_SIZE</B>
106
Pass a pointer to a long to receive the total size
107
of the issued requests. This is so far only for HTTP
108
requests. Note that this may be more than one
109
request if FOLLOWLOCATION is true.
111
<B>CURLINFO_SSL_VERIFYRESULT</B>
112
Pass a pointer to a long to receive the result of
113
the certification verification that was requested
114
(using the CURLOPT_SSL_VERIFYPEER option to
115
curl_easy_setopt). (Added in 7.4.2)
117
<B>CURLINFO_CONTENT_LENGTH_DOWNLOAD</B>
118
Pass a pointer to a double to receive the content-
119
length of the download. This is the value read from
120
the Content-Length: field. (Added in 7.6.1)
122
<B>CURLINFO_CONTENT_LENGTH_UPLOAD</B>
123
Pass a pointer to a double to receive the specified
124
size of the upload. (Added in 7.6.1)
126
<B>CURLINFO_CONTENT_TYPE</B>
127
Pass a pointer to a 'char *' to receive the content-
128
type of the downloaded object. This is the value
129
read from the Content-Type: field. If you get NULL,
130
it means that the server didn't send a valid Con�
131
tent-Type header or that the protocol used doesn't
132
support this. (Added in 7.9.4)
136
<H2>RETURN VALUE</H2><PRE>
137
If the operation was successful, CURLE_OK is returned. Oth�
138
erwise an appropriate error code will be returned.
142
<H2>SEE ALSO</H2><PRE>
143
<B>curl_easy_setopt(3)</B>
148
Surely there are some, you tell me!
178
Man(1) output converted with
179
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
2
<title>curl_easy_getinfo man page</title>
3
<meta name="generator" content="roffit 0.7">
4
<STYLE type="text/css">
30
background-color: #e0e0e0;
36
font-family: monospace;
46
<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
47
<p class="level0">curl_easy_getinfo - extract information from a curl handle <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
48
<p class="level0"><span Class="bold">#include <curl/curl.h></span>
49
<p class="level0"><span Class="bold">CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );</span>
50
<p class="level0"><a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
51
<p class="level0">Request internal information from the curl session with this function. The third argument <span Class="bold">MUST</span> be a pointer to a long, a pointer to a char * or a pointer to a double (as this documentation describes further down). The data pointed-to will be filled in accordingly and can be relied upon only if the function returns CURLE_OK. This function is intended to get used *AFTER* a performed transfer, all results from this function are undefined until the transfer is completed. <a name="AVAILABLE"></a><h2 class="nroffsh">AVAILABLE INFORMATION</h2>
52
<p class="level0">The following information can be extracted:
53
<p class="level0"><a name="CURLINFOEFFECTIVEURL"></a><span class="nroffip">CURLINFO_EFFECTIVE_URL</span>
54
<p class="level1">Pass a pointer to a 'char *' to receive the last used effective URL.
55
<p class="level0"><a name="CURLINFORESPONSECODE"></a><span class="nroffip">CURLINFO_RESPONSE_CODE</span>
56
<p class="level1">Pass a pointer to a long to receive the last received HTTP or FTP code. This option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier.
57
<p class="level0"><a name="CURLINFOFILETIME"></a><span class="nroffip">CURLINFO_FILETIME</span>
58
<p class="level1">Pass a pointer to a long to receive the remote time of the retrieved document. If you get -1, it can be because of many reasons (unknown, the server hides it or the server doesn't support the command that tells document time etc) and the time of the document is unknown. Note that you must tell the server to collect this information before the transfer is made, by using the CURLOPT_FILETIME option to <a class="emphasis" href="./curl_easy_setopt.html">curl_easy_setopt(3)</a>. (Added in 7.5)
59
<p class="level0"><a name="CURLINFOTOTALTIME"></a><span class="nroffip">CURLINFO_TOTAL_TIME</span>
60
<p class="level1">Pass a pointer to a double to receive the total transaction time in seconds for the previous transfer. This time does not include the connect time, so if you want the complete operation time, you should add the CURLINFO_CONNECT_TIME.
61
<p class="level0"><a name="CURLINFONAMELOOKUPTIME"></a><span class="nroffip">CURLINFO_NAMELOOKUP_TIME</span>
62
<p class="level1">Pass a pointer to a double to receive the time, in seconds, it took from the start until the name resolving was completed.
63
<p class="level0"><a name="CURLINFOCONNECTTIME"></a><span class="nroffip">CURLINFO_CONNECT_TIME</span>
64
<p class="level1">Pass a pointer to a double to receive the time, in seconds, it took from the start until the connect to the remote host (or proxy) was completed.
65
<p class="level0"><a name="CURLINFOPRETRANSFERTIME"></a><span class="nroffip">CURLINFO_PRETRANSFER_TIME</span>
66
<p class="level1">Pass a pointer to a double to receive the time, in seconds, it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.
67
<p class="level0"><a name="CURLINFOSTARTTRANSFERTIME"></a><span class="nroffip">CURLINFO_STARTTRANSFER_TIME</span>
68
<p class="level1">Pass a pointer to a double to receive the time, in seconds, it took from the start until the first byte is just about to be transferred. This includes CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate the result.
69
<p class="level0"><a name="CURLINFOREDIRECTTIME"></a><span class="nroffip">CURLINFO_REDIRECT_TIME</span>
70
<p class="level1">Pass a pointer to a double to receive the total time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. CURLINFO_REDIRECT_TIME contains the complete execution time for multiple redirections. (Added in 7.9.7)
71
<p class="level0"><a name="CURLINFOREDIRECTCOUNT"></a><span class="nroffip">CURLINFO_REDIRECT_COUNT</span>
72
<p class="level1">Pass a pointer to a long to receive the total number of redirections that were actually followed. (Added in 7.9.7)
73
<p class="level0"><a name="CURLINFOSIZEUPLOAD"></a><span class="nroffip">CURLINFO_SIZE_UPLOAD</span>
74
<p class="level1">Pass a pointer to a double to receive the total amount of bytes that were uploaded.
75
<p class="level0"><a name="CURLINFOSIZEDOWNLOAD"></a><span class="nroffip">CURLINFO_SIZE_DOWNLOAD</span>
76
<p class="level1">Pass a pointer to a double to receive the total amount of bytes that were downloaded. The amount is only for the latest transfer and will be reset again for each new transfer.
77
<p class="level0"><a name="CURLINFOSPEEDDOWNLOAD"></a><span class="nroffip">CURLINFO_SPEED_DOWNLOAD</span>
78
<p class="level1">Pass a pointer to a double to receive the average download speed that curl measured for the complete download.
79
<p class="level0"><a name="CURLINFOSPEEDUPLOAD"></a><span class="nroffip">CURLINFO_SPEED_UPLOAD</span>
80
<p class="level1">Pass a pointer to a double to receive the average upload speed that curl measured for the complete upload.
81
<p class="level0"><a name="CURLINFOHEADERSIZE"></a><span class="nroffip">CURLINFO_HEADER_SIZE</span>
82
<p class="level1">Pass a pointer to a long to receive the total size of all the headers received.
83
<p class="level0"><a name="CURLINFOREQUESTSIZE"></a><span class="nroffip">CURLINFO_REQUEST_SIZE</span>
84
<p class="level1">Pass a pointer to a long to receive the total size of the issued requests. This is so far only for HTTP requests. Note that this may be more than one request if FOLLOWLOCATION is true.
85
<p class="level0"><a name="CURLINFOSSLVERIFYRESULT"></a><span class="nroffip">CURLINFO_SSL_VERIFYRESULT</span>
86
<p class="level1">Pass a pointer to a long to receive the result of the certification verification that was requested (using the CURLOPT_SSL_VERIFYPEER option to <a class="emphasis" href="./curl_easy_setopt.html">curl_easy_setopt(3)</a>).
87
<p class="level0"><a name="CURLINFOCONTENTLENGTHDOWNLOAD"></a><span class="nroffip">CURLINFO_CONTENT_LENGTH_DOWNLOAD</span>
88
<p class="level1">Pass a pointer to a double to receive the content-length of the download. This is the value read from the Content-Length: field.
89
<p class="level0"><a name="CURLINFOCONTENTLENGTHUPLOAD"></a><span class="nroffip">CURLINFO_CONTENT_LENGTH_UPLOAD</span>
90
<p class="level1">Pass a pointer to a double to receive the specified size of the upload.
91
<p class="level0"><a name="CURLINFOCONTENTTYPE"></a><span class="nroffip">CURLINFO_CONTENT_TYPE</span>
92
<p class="level1">Pass a pointer to a 'char *' to receive the content-type of the downloaded object. This is the value read from the Content-Type: field. If you get NULL, it means that the server didn't send a valid Content-Type header or that the protocol used doesn't support this.
93
<p class="level0"><a name="CURLINFOPRIVATE"></a><span class="nroffip">CURLINFO_PRIVATE</span>
94
<p class="level1">Pass a pointer to a 'char *' to receive the pointer to the private data associated with the curl handle (set with the CURLOPT_PRIVATE option to <a class="emphasis" href="./curl_easy_setopt.html">curl_easy_setopt(3)</a>). (Added in 7.10.3)
95
<p class="level0"><a name="CURLINFOHTTPAUTHAVAIL"></a><span class="nroffip">CURLINFO_HTTPAUTH_AVAIL</span>
96
<p class="level1">Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available. The meaning of the bits is explained in the CURLOPT_HTTPAUTH option for <a class="emphasis" href="./curl_easy_setopt.html">curl_easy_setopt(3)</a>. (Added in 7.10.8)
97
<p class="level0"><a name="CURLINFOPROXYAUTHAVAIL"></a><span class="nroffip">CURLINFO_PROXYAUTH_AVAIL</span>
98
<p class="level1">Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available for your proxy authentication. (Added in 7.10.8) <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
99
<p class="level0">If the operation was successful, CURLE_OK is returned. Otherwise an appropriate error code will be returned. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
100
<p class="level0"><a class="manpage" href="./curl_easy_setopt.html">curl_easy_setopt (3)</a> <p class="roffit">
101
This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.