reference/curl/functions/curl-getinfo.xml
8b3f89ed6171cb711b00afb0fcacbea3462537b9
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xml:id='function.curl-getinfo' xmlns="http://docbook.org/ns/docbook">
3
+
<refentry xml:id="function.curl-getinfo" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>curl_getinfo</refname>
6
6
<refpurpose>Get information regarding a specific transfer</refpurpose>
...
...
@@ -10,8 +10,8 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>mixed</type><methodname>curl_getinfo</methodname>
13
-
<methodparam><type>resource</type><parameter>ch</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>opt</parameter><initializer>0</initializer></methodparam>
13
+
<methodparam><type>CurlHandle</type><parameter>handle</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>option</parameter><initializer>&null;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Gets information about the last transfer.
...
...
@@ -24,149 +24,550 @@
24
24
<variablelist>
25
25
&curl.ch.description;
26
26
<varlistentry>
27
-
<term><parameter>opt</parameter></term>
27
+
<term><parameter>option</parameter></term>
28
28
<listitem>
29
29
<para>
30
30
This may be one of the following constants:
31
-
<itemizedlist>
32
-
<listitem>
33
-
<simpara>
34
-
<constant>CURLINFO_EFFECTIVE_URL</constant> - Last effective URL
35
-
</simpara>
36
-
</listitem>
37
-
<listitem>
38
-
<simpara>
39
-
<constant>CURLINFO_HTTP_CODE</constant> - Last received HTTP code
40
-
</simpara>
41
-
</listitem>
42
-
<listitem>
43
-
<simpara>
44
-
<constant>CURLINFO_FILETIME</constant> - Remote time of the retrieved document, if -1 is returned the time of the document is unknown
45
-
</simpara>
46
-
</listitem>
47
-
<listitem>
48
-
<simpara>
49
-
<constant>CURLINFO_TOTAL_TIME</constant> - Total transaction time in seconds for last transfer
50
-
</simpara>
51
-
</listitem>
52
-
<listitem>
53
-
<simpara>
54
-
<constant>CURLINFO_NAMELOOKUP_TIME</constant> - Time in seconds until name resolving was complete
55
-
</simpara>
56
-
</listitem>
57
-
<listitem>
58
-
<simpara>
59
-
<constant>CURLINFO_CONNECT_TIME</constant> - Time in seconds it took to establish the connection
60
-
</simpara>
61
-
</listitem>
62
-
<listitem>
63
-
<simpara>
64
-
<constant>CURLINFO_PRETRANSFER_TIME</constant> - Time in seconds from start until just before file transfer begins
65
-
</simpara>
66
-
</listitem>
67
-
<listitem>
68
-
<simpara>
69
-
<constant>CURLINFO_STARTTRANSFER_TIME</constant> - Time in seconds until the first byte is about to be transferred
70
-
</simpara>
71
-
</listitem>
72
-
<listitem>
73
-
<simpara>
74
-
<constant>CURLINFO_REDIRECT_COUNT</constant> - Number of redirects, with the <constant>CURLOPT_FOLLOWLOCATION</constant> option enabled
75
-
</simpara>
76
-
</listitem>
77
-
<listitem>
78
-
<simpara>
79
-
<constant>CURLINFO_REDIRECT_TIME</constant> - Time in seconds of all redirection steps before final transaction was started, with the <constant>CURLOPT_FOLLOWLOCATION</constant> option enabled
80
-
</simpara>
81
-
</listitem>
82
-
<listitem>
83
-
<simpara>
84
-
<constant>CURLINFO_REDIRECT_URL</constant> - With the <constant>CURLOPT_FOLLOWLOCATION</constant> option disabled: redirect URL found in the last transaction, that should be requested manually next. With the <constant>CURLOPT_FOLLOWLOCATION</constant> option enabled: this is empty. The redirect URL in this case is available in <constant>CURLINFO_EFFECTIVE_URL</constant>
85
-
</simpara>
86
-
</listitem>
87
-
<listitem>
88
-
<simpara>
89
-
<constant>CURLINFO_PRIMARY_IP</constant> - IP address of the most recent connection
90
-
</simpara>
91
-
</listitem>
92
-
<listitem>
93
-
<simpara>
94
-
<constant>CURLINFO_PRIMARY_PORT</constant> - Destination port of the most recent connection
95
-
</simpara>
96
-
</listitem>
97
-
<listitem>
98
-
<simpara>
99
-
<constant>CURLINFO_LOCAL_IP</constant> - Local (source) IP address of the most recent connection
100
-
</simpara>
101
-
</listitem>
102
-
<listitem>
103
-
<simpara>
104
-
<constant>CURLINFO_LOCAL_PORT</constant> - Local (source) port of the most recent connection
105
-
</simpara>
106
-
</listitem>
107
-
<listitem>
108
-
<simpara>
109
-
<constant>CURLINFO_SIZE_UPLOAD</constant> - Total number of bytes uploaded
110
-
</simpara>
111
-
</listitem>
112
-
<listitem>
113
-
<simpara>
114
-
<constant>CURLINFO_SIZE_DOWNLOAD</constant> - Total number of bytes downloaded
115
-
</simpara>
116
-
</listitem>
117
-
<listitem>
118
-
<simpara>
119
-
<constant>CURLINFO_SPEED_DOWNLOAD</constant> - Average download speed
120
-
</simpara>
121
-
</listitem>
122
-
<listitem>
123
-
<simpara>
124
-
<constant>CURLINFO_SPEED_UPLOAD</constant> - Average upload speed
125
-
</simpara>
126
-
</listitem>
127
-
<listitem>
128
-
<simpara>
129
-
<constant>CURLINFO_HEADER_SIZE</constant> - Total size of all headers received
130
-
</simpara>
131
-
</listitem>
132
-
<listitem>
133
-
<simpara>
134
-
<constant>CURLINFO_HEADER_OUT</constant> - The request string sent. For this to
135
-
work, add the <constant>CURLINFO_HEADER_OUT</constant> option to the handle by calling
136
-
<function>curl_setopt</function>
137
-
</simpara>
138
-
</listitem>
139
-
<listitem>
140
-
<simpara>
141
-
<constant>CURLINFO_REQUEST_SIZE</constant> - Total size of issued requests, currently only for HTTP requests
142
-
</simpara>
143
-
</listitem>
144
-
<listitem>
145
-
<simpara>
146
-
<constant>CURLINFO_SSL_VERIFYRESULT</constant> - Result of SSL certification verification requested by setting <constant>CURLOPT_SSL_VERIFYPEER</constant>
147
-
</simpara>
148
-
</listitem>
149
-
<listitem>
150
-
<simpara>
151
-
<constant>CURLINFO_CONTENT_LENGTH_DOWNLOAD</constant> - content-length of download, read from <literal>Content-Length:</literal> field
152
-
</simpara>
153
-
</listitem>
154
-
<listitem>
155
-
<simpara>
156
-
<constant>CURLINFO_CONTENT_LENGTH_UPLOAD</constant> - Specified size of upload
157
-
</simpara>
158
-
</listitem>
159
-
<listitem>
160
-
<simpara>
161
-
<constant>CURLINFO_CONTENT_TYPE</constant> - <literal>Content-Type:</literal> of the requested document, NULL indicates server did not send valid <literal>Content-Type:</literal> header
162
-
</simpara>
163
-
</listitem>
164
-
<listitem>
165
-
<simpara>
166
-
<constant>CURLINFO_PRIVATE</constant> - Private data associated with this cURL handle, previously set with the <constant>CURLOPT_PRIVATE</constant> option of <function>curl_setopt</function>
167
-
</simpara>
168
-
</listitem>
169
-
</itemizedlist>
31
+
<informaltable>
32
+
<tgroup cols="3">
33
+
<thead>
34
+
<row>
35
+
<entry valign="top">Option</entry>
36
+
<entry valign="top">&Description;</entry>
37
+
</row>
38
+
</thead>
39
+
<tbody>
40
+
<row>
41
+
<entry valign="top">
42
+
<constant>CURLINFO_CAINFO</constant>
43
+
</entry>
44
+
<entry valign="top">
45
+
Default built-in CA certificate path
46
+
</entry>
47
+
</row>
48
+
<row>
49
+
<entry valign="top">
50
+
<constant>CURLINFO_CAPATH</constant>
51
+
</entry>
52
+
<entry valign="top">
53
+
Default built-in CA path string
54
+
</entry>
55
+
</row>
56
+
<row>
57
+
<entry valign="top">
58
+
<constant>CURLINFO_EFFECTIVE_URL</constant>
59
+
</entry>
60
+
<entry valign="top">
61
+
Last effective URL
62
+
</entry>
63
+
</row>
64
+
<row>
65
+
<entry valign="top">
66
+
<constant>CURLINFO_HTTP_CODE</constant>
67
+
</entry>
68
+
<entry valign="top">
69
+
The last response code. As of cURL 7.10.8, this is a legacy alias of CURLINFO_RESPONSE_CODE
70
+
</entry>
71
+
</row>
72
+
<row>
73
+
<entry valign="top">
74
+
<constant>CURLINFO_FILETIME</constant>
75
+
</entry>
76
+
<entry valign="top">
77
+
Remote time of the retrieved document, with the CURLOPT_FILETIME enabled; if -1 is returned the time of the document is unknown
78
+
</entry>
79
+
</row>
80
+
<row>
81
+
<entry valign="top">
82
+
<constant>CURLINFO_TOTAL_TIME</constant>
83
+
</entry>
84
+
<entry valign="top">
85
+
Total transaction time in seconds for last transfer
86
+
</entry>
87
+
</row>
88
+
<row>
89
+
<entry valign="top">
90
+
<constant>CURLINFO_NAMELOOKUP_TIME</constant>
91
+
</entry>
92
+
<entry valign="top">
93
+
Time in seconds until name resolving was complete
94
+
</entry>
95
+
</row>
96
+
<row>
97
+
<entry valign="top">
98
+
<constant>CURLINFO_CONNECT_TIME</constant>
99
+
</entry>
100
+
<entry valign="top">
101
+
Time in seconds it took to establish the connection
102
+
</entry>
103
+
</row>
104
+
<row>
105
+
<entry valign="top">
106
+
<constant>CURLINFO_PRETRANSFER_TIME</constant>
107
+
</entry>
108
+
<entry valign="top">
109
+
Time in seconds from start until just before file transfer begins
110
+
</entry>
111
+
</row>
112
+
<row>
113
+
<entry valign="top">
114
+
<constant>CURLINFO_STARTTRANSFER_TIME</constant>
115
+
</entry>
116
+
<entry valign="top">
117
+
Time in seconds until the first byte is about to be transferred
118
+
</entry>
119
+
</row>
120
+
<row>
121
+
<entry valign="top">
122
+
<constant>CURLINFO_REDIRECT_COUNT</constant>
123
+
</entry>
124
+
<entry valign="top">
125
+
Number of redirects, with the CURLOPT_FOLLOWLOCATION option enabled
126
+
</entry>
127
+
</row>
128
+
<row>
129
+
<entry valign="top">
130
+
<constant>CURLINFO_REDIRECT_TIME</constant>
131
+
</entry>
132
+
<entry valign="top">
133
+
Time in seconds of all redirection steps before final transaction was started, with the CURLOPT_FOLLOWLOCATION option enabled
134
+
</entry>
135
+
</row>
136
+
<row>
137
+
<entry valign="top">
138
+
<constant>CURLINFO_REDIRECT_URL</constant>
139
+
</entry>
140
+
<entry valign="top">
141
+
With the CURLOPT_FOLLOWLOCATION option disabled: redirect URL found in the last transaction, that should be requested manually next. With the CURLOPT_FOLLOWLOCATION option enabled: this is empty. The redirect URL in this case is available in CURLINFO_EFFECTIVE_URL
142
+
</entry>
143
+
</row>
144
+
<row>
145
+
<entry valign="top">
146
+
<constant>CURLINFO_PRIMARY_IP</constant>
147
+
</entry>
148
+
<entry valign="top">
149
+
IP address of the most recent connection
150
+
</entry>
151
+
</row>
152
+
<row>
153
+
<entry valign="top">
154
+
<constant>CURLINFO_PRIMARY_PORT</constant>
155
+
</entry>
156
+
<entry valign="top">
157
+
Destination port of the most recent connection
158
+
</entry>
159
+
</row>
160
+
<row>
161
+
<entry valign="top">
162
+
<constant>CURLINFO_LOCAL_IP</constant>
163
+
</entry>
164
+
<entry valign="top">
165
+
Local (source) IP address of the most recent connection
166
+
</entry>
167
+
</row>
168
+
<row>
169
+
<entry valign="top">
170
+
<constant>CURLINFO_LOCAL_PORT</constant>
171
+
</entry>
172
+
<entry valign="top">
173
+
Local (source) port of the most recent connection
174
+
</entry>
175
+
</row>
176
+
<row>
177
+
<entry valign="top">
178
+
<constant>CURLINFO_SIZE_UPLOAD</constant>
179
+
</entry>
180
+
<entry valign="top">
181
+
Total number of bytes uploaded
182
+
</entry>
183
+
</row>
184
+
<row>
185
+
<entry valign="top">
186
+
<constant>CURLINFO_SIZE_DOWNLOAD</constant>
187
+
</entry>
188
+
<entry valign="top">
189
+
Total number of bytes downloaded
190
+
</entry>
191
+
</row>
192
+
<row>
193
+
<entry valign="top">
194
+
<constant>CURLINFO_SPEED_DOWNLOAD</constant>
195
+
</entry>
196
+
<entry valign="top">
197
+
Average download speed
198
+
</entry>
199
+
</row>
200
+
<row>
201
+
<entry valign="top">
202
+
<constant>CURLINFO_SPEED_UPLOAD</constant>
203
+
</entry>
204
+
<entry valign="top">
205
+
Average upload speed
206
+
</entry>
207
+
</row>
208
+
<row>
209
+
<entry valign="top">
210
+
<constant>CURLINFO_HEADER_SIZE</constant>
211
+
</entry>
212
+
<entry valign="top">
213
+
Total size of all headers received
214
+
</entry>
215
+
</row>
216
+
<row>
217
+
<entry valign="top">
218
+
<constant>CURLINFO_HEADER_OUT</constant>
219
+
</entry>
220
+
<entry valign="top">
221
+
The request string sent. For this to work, add the CURLINFO_HEADER_OUT option to the handle by calling curl_setopt()
222
+
</entry>
223
+
</row>
224
+
<row>
225
+
<entry valign="top">
226
+
<constant>CURLINFO_REFERER</constant>
227
+
</entry>
228
+
<entry valign="top">
229
+
The referrer header
230
+
</entry>
231
+
</row>
232
+
<row>
233
+
<entry valign="top">
234
+
<constant>CURLINFO_REQUEST_SIZE</constant>
235
+
</entry>
236
+
<entry valign="top">
237
+
Total size of issued requests, currently only for HTTP requests
238
+
</entry>
239
+
</row>
240
+
<row>
241
+
<entry valign="top">
242
+
<constant>CURLINFO_RETRY_AFTER</constant>
243
+
</entry>
244
+
<entry valign="top">
245
+
The information from the Retry-After: header, or zero if there was no valid header.
246
+
</entry>
247
+
</row>
248
+
<row>
249
+
<entry valign="top">
250
+
<constant>CURLINFO_SSL_VERIFYRESULT</constant>
251
+
</entry>
252
+
<entry valign="top">
253
+
Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER
254
+
</entry>
255
+
</row>
256
+
<row>
257
+
<entry valign="top">
258
+
<constant>CURLINFO_CONTENT_LENGTH_DOWNLOAD</constant>
259
+
</entry>
260
+
<entry valign="top">
261
+
Content length of download, read from Content-Length: field
262
+
</entry>
263
+
</row>
264
+
<row>
265
+
<entry valign="top">
266
+
<constant>CURLINFO_CONTENT_LENGTH_UPLOAD</constant>
267
+
</entry>
268
+
<entry valign="top">
269
+
Specified size of upload
270
+
</entry>
271
+
</row>
272
+
<row>
273
+
<entry valign="top">
274
+
<constant>CURLINFO_CONTENT_TYPE</constant>
275
+
</entry>
276
+
<entry valign="top">
277
+
Content-Type: of the requested document. NULL indicates server did not send valid Content-Type: header
278
+
</entry>
279
+
</row>
280
+
<row>
281
+
<entry valign="top">
282
+
<constant>CURLINFO_PRIVATE</constant>
283
+
</entry>
284
+
<entry valign="top">
285
+
Private data associated with this cURL handle, previously set with the CURLOPT_PRIVATE option of curl_setopt()
286
+
</entry>
287
+
</row>
288
+
<row>
289
+
<entry valign="top">
290
+
<constant>CURLINFO_PROXY_ERROR</constant>
291
+
</entry>
292
+
<entry valign="top">
293
+
The detailed (SOCKS) proxy error code when the most recent transfer returned a CURLE_PROXY error. The returned value will be exactly one of the CURLPX_* values. The error code will be CURLPX_OK if no response code was available.
294
+
</entry>
295
+
</row>
296
+
<row>
297
+
<entry valign="top">
298
+
<constant>CURLINFO_RESPONSE_CODE</constant>
299
+
</entry>
300
+
<entry valign="top">
301
+
The last response code
302
+
</entry>
303
+
</row>
304
+
<row>
305
+
<entry valign="top">
306
+
<constant>CURLINFO_HTTP_CONNECTCODE</constant>
307
+
</entry>
308
+
<entry valign="top">
309
+
The CONNECT response code
310
+
</entry>
311
+
</row>
312
+
<row>
313
+
<entry valign="top">
314
+
<constant>CURLINFO_HTTPAUTH_AVAIL</constant>
315
+
</entry>
316
+
<entry valign="top">
317
+
Bitmask indicating the authentication method(s) available according to the previous response
318
+
</entry>
319
+
</row>
320
+
<row>
321
+
<entry valign="top">
322
+
<constant>CURLINFO_PROXYAUTH_AVAIL</constant>
323
+
</entry>
324
+
<entry valign="top">
325
+
Bitmask indicating the proxy authentication method(s) available according to the previous response
326
+
</entry>
327
+
</row>
328
+
<row>
329
+
<entry valign="top">
330
+
<constant>CURLINFO_OS_ERRNO</constant>
331
+
</entry>
332
+
<entry valign="top">
333
+
Errno from a connect failure. The number is OS and system specific.
334
+
</entry>
335
+
</row>
336
+
<row>
337
+
<entry valign="top">
338
+
<constant>CURLINFO_NUM_CONNECTS</constant>
339
+
</entry>
340
+
<entry valign="top">
341
+
Number of connections curl had to create to achieve the previous transfer
342
+
</entry>
343
+
</row>
344
+
<row>
345
+
<entry valign="top">
346
+
<constant>CURLINFO_SSL_ENGINES</constant>
347
+
</entry>
348
+
<entry valign="top">
349
+
OpenSSL crypto-engines supported
350
+
</entry>
351
+
</row>
352
+
<row>
353
+
<entry valign="top">
354
+
<constant>CURLINFO_COOKIELIST</constant>
355
+
</entry>
356
+
<entry valign="top">
357
+
All known cookies
358
+
</entry>
359
+
</row>
360
+
<row>
361
+
<entry valign="top">
362
+
<constant>CURLINFO_FTP_ENTRY_PATH</constant>
363
+
</entry>
364
+
<entry valign="top">
365
+
Entry path in FTP server
366
+
</entry>
367
+
</row>
368
+
<row>
369
+
<entry valign="top">
370
+
<constant>CURLINFO_APPCONNECT_TIME</constant>
371
+
</entry>
372
+
<entry valign="top">
373
+
Time in seconds it took from the start until the SSL/SSH connect/handshake to the remote host was completed
374
+
</entry>
375
+
</row>
376
+
<row>
377
+
<entry valign="top">
378
+
<constant>CURLINFO_CERTINFO</constant>
379
+
</entry>
380
+
<entry valign="top">
381
+
TLS certificate chain
382
+
</entry>
383
+
</row>
384
+
<row>
385
+
<entry valign="top">
386
+
<constant>CURLINFO_CONDITION_UNMET</constant>
387
+
</entry>
388
+
<entry valign="top">
389
+
Info on unmet time conditional
390
+
</entry>
391
+
</row>
392
+
<row>
393
+
<entry valign="top">
394
+
<constant>CURLINFO_RTSP_CLIENT_CSEQ</constant>
395
+
</entry>
396
+
<entry valign="top">
397
+
Next RTSP client CSeq
398
+
</entry>
399
+
</row>
400
+
<row>
401
+
<entry valign="top">
402
+
<constant>CURLINFO_RTSP_CSEQ_RECV</constant>
403
+
</entry>
404
+
<entry valign="top">
405
+
Recently received CSeq
406
+
</entry>
407
+
</row>
408
+
<row>
409
+
<entry valign="top">
410
+
<constant>CURLINFO_RTSP_SERVER_CSEQ</constant>
411
+
</entry>
412
+
<entry valign="top">
413
+
Next RTSP server CSeq
414
+
</entry>
415
+
</row>
416
+
<row>
417
+
<entry valign="top">
418
+
<constant>CURLINFO_RTSP_SESSION_ID</constant>
419
+
</entry>
420
+
<entry valign="top">
421
+
RTSP session ID
422
+
</entry>
423
+
</row>
424
+
<row>
425
+
<entry valign="top">
426
+
<constant>CURLINFO_CONTENT_LENGTH_DOWNLOAD_T</constant>
427
+
</entry>
428
+
<entry valign="top">
429
+
The content-length of the download. This is the value read from the Content-Length: field. -1 if the size isn't known
430
+
</entry>
431
+
</row>
432
+
<row>
433
+
<entry valign="top">
434
+
<constant>CURLINFO_CONTENT_LENGTH_UPLOAD_T</constant>
435
+
</entry>
436
+
<entry valign="top">
437
+
The specified size of the upload. -1 if the size isn't known
438
+
</entry>
439
+
</row>
440
+
<row>
441
+
<entry valign="top">
442
+
<constant>CURLINFO_HTTP_VERSION</constant>
443
+
</entry>
444
+
<entry valign="top">
445
+
The version used in the last HTTP connection. The return value will be one of the defined CURL_HTTP_VERSION_* constants or 0 if the version can't be determined
446
+
</entry>
447
+
</row>
448
+
<row>
449
+
<entry valign="top">
450
+
<constant>CURLINFO_PROTOCOL</constant>
451
+
</entry>
452
+
<entry valign="top">
453
+
The protocol used in the last HTTP connection. The returned value will be exactly one of the CURLPROTO_* values
454
+
</entry>
455
+
</row>
456
+
<row>
457
+
<entry valign="top">
458
+
<constant>CURLINFO_PROXY_SSL_VERIFYRESULT</constant>
459
+
</entry>
460
+
<entry valign="top">
461
+
The result of the certificate verification that was requested (using the CURLOPT_PROXY_SSL_VERIFYPEER option). Only used for HTTPS proxies
462
+
</entry>
463
+
</row>
464
+
<row>
465
+
<entry valign="top">
466
+
<constant>CURLINFO_SCHEME</constant>
467
+
</entry>
468
+
<entry valign="top">
469
+
The URL scheme used for the most recent connection
470
+
</entry>
471
+
</row>
472
+
<row>
473
+
<entry valign="top">
474
+
<constant>CURLINFO_SIZE_DOWNLOAD_T</constant>
475
+
</entry>
476
+
<entry valign="top">
477
+
Total number of bytes that were downloaded. The number is only for the latest transfer and will be reset again for each new transfer
478
+
</entry>
479
+
</row>
480
+
<row>
481
+
<entry valign="top">
482
+
<constant>CURLINFO_SIZE_UPLOAD_T</constant>
483
+
</entry>
484
+
<entry valign="top">
485
+
Total number of bytes that were uploaded
486
+
</entry>
487
+
</row>
488
+
<row>
489
+
<entry valign="top">
490
+
<constant>CURLINFO_SPEED_DOWNLOAD_T</constant>
491
+
</entry>
492
+
<entry valign="top">
493
+
The average download speed in bytes/second that curl measured for the complete download
494
+
</entry>
495
+
</row>
496
+
<row>
497
+
<entry valign="top">
498
+
<constant>CURLINFO_SPEED_UPLOAD_T</constant>
499
+
</entry>
500
+
<entry valign="top">
501
+
The average upload speed in bytes/second that curl measured for the complete upload
502
+
</entry>
503
+
</row>
504
+
<row>
505
+
<entry valign="top">
506
+
<constant>CURLINFO_APPCONNECT_TIME_T</constant>
507
+
</entry>
508
+
<entry valign="top">
509
+
Time, in microseconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed
510
+
</entry>
511
+
</row>
512
+
<row>
513
+
<entry valign="top">
514
+
<constant>CURLINFO_CONNECT_TIME_T</constant>
515
+
</entry>
516
+
<entry valign="top">
517
+
Total time taken, in microseconds, from the start until the connection to the remote host (or proxy) was completed
518
+
</entry>
519
+
</row>
520
+
<row>
521
+
<entry valign="top">
522
+
<constant>CURLINFO_FILETIME_T</constant>
523
+
</entry>
524
+
<entry valign="top">
525
+
Remote time of the retrieved document (as Unix timestamp), an alternative to CURLINFO_FILETIME to allow systems with 32 bit long variables to extract dates outside of the 32bit timestamp range
526
+
</entry>
527
+
</row>
528
+
<row>
529
+
<entry valign="top">
530
+
<constant>CURLINFO_NAMELOOKUP_TIME_T</constant>
531
+
</entry>
532
+
<entry valign="top">
533
+
Time in microseconds from the start until the name resolving was completed
534
+
</entry>
535
+
</row>
536
+
<row>
537
+
<entry valign="top">
538
+
<constant>CURLINFO_PRETRANSFER_TIME_T</constant>
539
+
</entry>
540
+
<entry valign="top">
541
+
Time taken from the start until the file transfer is just about to begin, in microseconds
542
+
</entry>
543
+
</row>
544
+
<row>
545
+
<entry valign="top">
546
+
<constant>CURLINFO_REDIRECT_TIME_T</constant>
547
+
</entry>
548
+
<entry valign="top">
549
+
Total time, in microseconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started
550
+
</entry>
551
+
</row>
552
+
<row>
553
+
<entry valign="top">
554
+
<constant>CURLINFO_STARTTRANSFER_TIME_T</constant>
555
+
</entry>
556
+
<entry valign="top">
557
+
Time, in microseconds, it took from the start until the first byte is received
558
+
</entry>
559
+
</row>
560
+
<row>
561
+
<entry valign="top">
562
+
<constant>CURLINFO_TOTAL_TIME_T</constant>
563
+
</entry>
564
+
<entry valign="top">
565
+
Total time in microseconds for the previous transfer, including name resolving, TCP connect etc.
566
+
</entry>
567
+
</row>
568
+
</tbody>
569
+
</tgroup>
570
+
</informaltable>
170
571
</para>
171
572
</listitem>
172
573
</varlistentry>
...
...
@@ -177,9 +578,9 @@
177
578
<refsect1 role="returnvalues">
178
579
&reftitle.returnvalues;
179
580
<para>
180
-
If <parameter>opt</parameter> is given, returns its value.
581
+
If <parameter>option</parameter> is given, returns its value.
181
582
Otherwise, returns an associative array with the following elements
182
-
(which correspond to <parameter>opt</parameter>), or &false; on failure:
583
+
(which correspond to <parameter>option</parameter>), or &false; on failure:
183
584
<itemizedlist>
184
585
<listitem>
185
586
<simpara>
...
...
@@ -335,30 +736,49 @@
335
736
</thead>
336
737
<tbody>
337
738
<row>
338
-
<entry>5.4.7</entry>
739
+
<entry>8.3.0</entry>
339
740
<entry>
340
-
Introduced <constant>CURLINFO_PRIMARY_IP</constant>,
341
-
<constant>CURLINFO_PRIMARY_PORT</constant>,
342
-
<constant>CURLINFO_LOCAL_IP</constant> and
343
-
<constant>CURLINFO_LOCAL_PORT</constant>.
741
+
Introduced <constant>CURLINFO_CAINFO</constant>
742
+
and <constant>CURLINFO_CAPATH</constant>.
344
743
</entry>
345
744
</row>
346
745
<row>
347
-
<entry>5.3.7</entry>
746
+
<entry>8.2.0</entry>
348
747
<entry>
349
-
Introduced <constant>CURLINFO_REDIRECT_URL</constant>.
748
+
Introduced <constant>CURLINFO_PROXY_ERROR</constant>,
749
+
<constant>CURLINFO_REFERER</constant>,
750
+
<constant>CURLINFO_RETRY_AFTER</constant>.
350
751
</entry>
351
752
</row>
753
+
&curl.changelog.handle-param;
352
754
<row>
353
-
<entry>5.2.4</entry>
755
+
<entry>8.0.0</entry>
354
756
<entry>
355
-
Introduced <constant>CURLINFO_PRIVATE</constant>.
757
+
<parameter>option</parameter> is nullable now;
758
+
previously, the default was <literal>0</literal>.
356
759
</entry>
357
760
</row>
358
761
<row>
359
-
<entry>5.1.3</entry>
762
+
<entry>7.3.0</entry>
360
763
<entry>
361
-
Introduced <constant>CURLINFO_HEADER_OUT</constant>.
764
+
Introduced <constant>CURLINFO_CONTENT_LENGTH_DOWNLOAD_T</constant>,
765
+
<constant>CURLINFO_CONTENT_LENGTH_UPLOAD_T</constant>,
766
+
<constant>CURLINFO_HTTP_VERSION</constant>,
767
+
<constant>CURLINFO_PROTOCOL</constant>,
768
+
<constant>CURLINFO_PROXY_SSL_VERIFYRESULT</constant>,
769
+
<constant>CURLINFO_SCHEME</constant>,
770
+
<constant>CURLINFO_SIZE_DOWNLOAD_T</constant>,
771
+
<constant>CURLINFO_SIZE_UPLOAD_T</constant>,
772
+
<constant>CURLINFO_SPEED_DOWNLOAD_T</constant>,
773
+
<constant>CURLINFO_SPEED_UPLOAD_T</constant>,
774
+
<constant>CURLINFO_APPCONNECT_TIME_T</constant>,
775
+
<constant>CURLINFO_CONNECT_TIME_T</constant>,
776
+
<constant>CURLINFO_FILETIME_T</constant>,
777
+
<constant>CURLINFO_NAMELOOKUP_TIME_T</constant>,
778
+
<constant>CURLINFO_PRETRANSFER_TIME_T</constant>,
779
+
<constant>CURLINFO_REDIRECT_TIME_T</constant>,
780
+
<constant>CURLINFO_STARTTRANSFER_TIME_T</constant>,
781
+
<constant>CURLINFO_TOTAL_TIME_T</constant>.
362
782
</entry>
363
783
</row>
364
784
</tbody>
...
...
@@ -375,18 +795,45 @@
375
795
<programlisting role="php">
376
796
<![CDATA[
377
797
<?php
378
-
// Create a curl handle
379
-
$ch = curl_init('http://www.yahoo.com/');
798
+
// Create a cURL handle
799
+
$ch = curl_init('http://www.example.com/');
380
800

381
801
// Execute
382
802
curl_exec($ch);
383
803

384
804
// Check if any error occurred
385
-
if(!curl_errno($ch))
386
-
{
387
-
$info = curl_getinfo($ch);
805
+
if (!curl_errno($ch)) {
806
+
$info = curl_getinfo($ch);
807
+
echo 'Took ', $info['total_time'], ' seconds to send a request to ', $info['url'], "\n";
808
+
}
809
+

810
+
// Close handle
811
+
curl_close($ch);
812
+
?>
813
+
]]>
814
+
</programlisting>
815
+
</example>
816
+
</para>
817
+
<para>
818
+
<example>
819
+
<title><function>curl_getinfo</function> example with <parameter>option</parameter> parameter</title>
820
+
<programlisting role="php">
821
+
<![CDATA[
822
+
<?php
823
+
// Create a cURL handle
824
+
$ch = curl_init('http://www.example.com/');
388
825

389
-
echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url'];
826
+
// Execute
827
+
curl_exec($ch);
828
+

829
+
// Check HTTP status code
830
+
if (!curl_errno($ch)) {
831
+
switch ($http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE)) {
832
+
case 200: # OK
833
+
break;
834
+
default:
835
+
echo 'Unexpected HTTP code: ', $http_code, "\n";
836
+
}
390
837
}
391
838

392
839
// Close handle
...
...
@@ -409,7 +856,6 @@ curl_close($ch);
409
856
</note>
410
857
</refsect1>
411
858
</refentry>
412
-

413
859
<!-- Keep this comment at the end of the file
414
860
Local variables:
415
861
mode: sgml
416
862