~ubuntu-branches/ubuntu/warty/curl/warty

« back to all changes in this revision

Viewing changes to docs/libcurl/curl_easy_getinfo.html

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli
  • Date: 2004-06-04 19:09:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040604190925-wy048bp31320r2z6
Tags: 7.12.0.is.7.11.2-1
* Reverted to version 7.11.2 (closes: #252348).
* Disabled support for libidn (closes: #252367). This is to leave
  curl in unstable as much similar as possible to the one in testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<HTML>
2
 
<BODY>
3
 
<PRE>
4
 
<!-- Manpage converted by man2html 3.0.1 -->
5
 
 
6
 
</PRE>
7
 
<H2>NAME</H2><PRE>
8
 
     curl_easy_getinfo  - Extract information from a curl session
9
 
     (added in 7.4)
10
 
 
11
 
 
12
 
</PRE>
13
 
<H2>SYNOPSIS</H2><PRE>
14
 
     <B>#include</B> <B>&lt;curl/curl.h&gt;</B>
15
 
 
16
 
     <B>CURLcode</B> <B>curl_easy_getinfo(CURL</B> <B>*curl,</B> <B>CURLINFO</B> <B>info,</B> <B>...</B> <B>);</B>
17
 
 
18
 
 
19
 
</PRE>
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.
29
 
 
30
 
 
31
 
</PRE>
32
 
<H2>AVAILABLE INFORMATION</H2><PRE>
33
 
     These are informations that can be extracted:
34
 
 
35
 
     <B>CURLINFO_EFFECTIVE_URL</B>
36
 
             Pass a pointer to a 'char *'  to  receive  the  last
37
 
             used effective URL.
38
 
 
39
 
     <B>CURLINFO_HTTP_CODE</B>
40
 
             Pass  a  pointer  to  a  long  to  receive  the last
41
 
             received HTTP code.
42
 
 
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)
53
 
 
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�
57
 
             fer.
58
 
 
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.
63
 
 
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.
68
 
 
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.
75
 
 
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.
82
 
 
83
 
     <B>CURLINFO_SIZE_UPLOAD</B>
84
 
             Pass a pointer to a  double  to  receive  the  total
85
 
             amount of bytes that were uploaded.
86
 
 
87
 
     <B>CURLINFO_SIZE_DOWNLOAD</B>
88
 
             Pass  a  pointer  to  a  double to receive the total
89
 
             amount of bytes that were downloaded.
90
 
 
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
94
 
             download.
95
 
 
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
99
 
             upload.
100
 
 
101
 
     <B>CURLINFO_HEADER_SIZE</B>
102
 
             Pass a pointer to a long to receive the  total  size
103
 
             of all the headers received.
104
 
 
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.
110
 
 
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)
116
 
 
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)
121
 
 
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)
125
 
 
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)
133
 
 
134
 
 
135
 
</PRE>
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.
139
 
 
140
 
 
141
 
</PRE>
142
 
<H2>SEE ALSO</H2><PRE>
143
 
     <B>curl_easy_setopt(3)</B>
144
 
 
145
 
 
146
 
</PRE>
147
 
<H2>BUGS</H2><PRE>
148
 
     Surely there are some, you tell me!
149
 
 
150
 
 
151
 
 
152
 
 
153
 
 
154
 
 
155
 
 
156
 
 
157
 
 
158
 
 
159
 
 
160
 
 
161
 
 
162
 
 
163
 
 
164
 
 
165
 
 
166
 
 
167
 
 
168
 
 
169
 
 
170
 
 
171
 
 
172
 
 
173
 
 
174
 
 
175
 
</PRE>
176
 
<HR>
177
 
<ADDRESS>
178
 
Man(1) output converted with
179
 
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
180
 
</ADDRESS>
181
 
</BODY>
182
 
</HTML>
 
1
<html><head>
 
2
<title>curl_easy_getinfo man page</title>
 
3
<meta name="generator" content="roffit 0.7">
 
4
<STYLE type="text/css">
 
5
P.level0 {
 
6
 padding-left: 2em;
 
7
}
 
8
 
 
9
P.level1 {
 
10
 padding-left: 4em;
 
11
}
 
12
 
 
13
P.level2 {
 
14
 padding-left: 6em;
 
15
}
 
16
 
 
17
span.emphasis {
 
18
 font-style: italic;
 
19
}
 
20
 
 
21
span.bold {
 
22
 font-weight: bold;
 
23
}
 
24
 
 
25
span.manpage {
 
26
 font-weight: bold;
 
27
}
 
28
 
 
29
h2.nroffsh {
 
30
 background-color: #e0e0e0;
 
31
}
 
32
 
 
33
span.nroffip {
 
34
 font-weight: bold;
 
35
 font-size: 120%;
 
36
 font-family: monospace;
 
37
}
 
38
 
 
39
p.roffit {
 
40
 text-align: center;
 
41
 font-size: 80%;
 
42
}
 
43
</STYLE>
 
44
</head><body>
 
45
 
 
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 &lt;curl/curl.h&gt;</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>.
 
102
</body></html>