blob: 3a93671e5c20b33a8498754b6e31cdd19396e8a0 [file] [log] [blame]
Lucas Eckels9bd90e62012-08-06 15:07:02 -07001.\" **************************************************************************
2.\" * _ _ ____ _
3.\" * Project ___| | | | _ \| |
4.\" * / __| | | | |_) | |
5.\" * | (__| |_| | _ <| |___
6.\" * \___|\___/|_| \_\_____|
7.\" *
Elliott Hughescac39802018-04-27 16:19:43 -07008.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
Lucas Eckels9bd90e62012-08-06 15:07:02 -07009.\" *
10.\" * This software is licensed as described in the file COPYING, which
11.\" * you should have received as part of this distribution. The terms
Alex Deymod15eaac2016-06-28 14:49:26 -070012.\" * are also available at https://curl.haxx.se/docs/copyright.html.
Lucas Eckels9bd90e62012-08-06 15:07:02 -070013.\" *
14.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15.\" * copies of the Software, and permit persons to whom the Software is
16.\" * furnished to do so, under the terms of the COPYING file.
17.\" *
18.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19.\" * KIND, either express or implied.
20.\" *
21.\" **************************************************************************
22.\"
Elliott Hughes1ef06ba2018-05-30 15:43:58 -070023.TH curl_easy_getinfo 3 "January 25, 2018" "libcurl 7.60.0" "libcurl Manual"
Elliott Hughes82be86d2017-09-20 17:00:17 -070024
Lucas Eckels9bd90e62012-08-06 15:07:02 -070025.SH NAME
26curl_easy_getinfo - extract information from a curl handle
27.SH SYNOPSIS
28.B #include <curl/curl.h>
29
30.B "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );"
31
32.SH DESCRIPTION
33Request internal information from the curl session with this function. The
34third argument \fBMUST\fP be a pointer to a long, a pointer to a char *, a
35pointer to a struct curl_slist * or a pointer to a double (as this
36documentation describes further down). The data pointed-to will be filled in
37accordingly and can be relied upon only if the function returns CURLE_OK. Use
Alex Deymod15eaac2016-06-28 14:49:26 -070038this function AFTER a performed transfer if you want to get transfer related
Lucas Eckels9bd90e62012-08-06 15:07:02 -070039data.
40
41You should not free the memory returned by this function unless it is
42explicitly mentioned below.
43.SH AVAILABLE INFORMATION
44The following information can be extracted:
45.IP CURLINFO_EFFECTIVE_URL
Alex Deymod15eaac2016-06-28 14:49:26 -070046Last used URL.
47See \fICURLINFO_EFFECTIVE_URL(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070048.IP CURLINFO_RESPONSE_CODE
Alex Deymod15eaac2016-06-28 14:49:26 -070049Last received response code.
50See \fICURLINFO_RESPONSE_CODE(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070051.IP CURLINFO_HTTP_CONNECTCODE
Alex Deymod15eaac2016-06-28 14:49:26 -070052Last proxy CONNECT response code.
53See \fICURLINFO_HTTP_CONNECTCODE(3)\fP
Alex Deymoe3149cc2016-10-05 11:18:42 -070054.IP CURLINFO_HTTP_VERSION
55The http version used in the connection.
56See \fICURLINFO_HTTP_VERSION(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070057.IP CURLINFO_FILETIME
Elliott Hughescac39802018-04-27 16:19:43 -070058Remote time of the retrieved document. See \fICURLINFO_FILETIME(3)\fP
59.IP CURLINFO_FILETIME_T
60Remote time of the retrieved document. See \fICURLINFO_FILETIME_T(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070061.IP CURLINFO_TOTAL_TIME
Alex Deymod15eaac2016-06-28 14:49:26 -070062Total time of previous transfer.
63See \fICURLINFO_TOTAL_TIME(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070064.IP CURLINFO_NAMELOOKUP_TIME
Alex Deymod15eaac2016-06-28 14:49:26 -070065Time from start until name resolving completed.
66See \fICURLINFO_NAMELOOKUP_TIME(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070067.IP CURLINFO_CONNECT_TIME
Alex Deymod15eaac2016-06-28 14:49:26 -070068Time from start until remote host or proxy completed.
69See \fICURLINFO_CONNECT_TIME(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070070.IP CURLINFO_APPCONNECT_TIME
Alex Deymod15eaac2016-06-28 14:49:26 -070071Time from start until SSL/SSH handshake completed.
72See \fICURLINFO_APPCONNECT_TIME(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070073.IP CURLINFO_PRETRANSFER_TIME
Alex Deymod15eaac2016-06-28 14:49:26 -070074Time from start until just before the transfer begins.
75See \fICURLINFO_PRETRANSFER_TIME(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070076.IP CURLINFO_STARTTRANSFER_TIME
Alex Deymod15eaac2016-06-28 14:49:26 -070077Time from start until just when the first byte is received.
78See \fICURLINFO_STARTTRANSFER_TIME(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070079.IP CURLINFO_REDIRECT_TIME
Alex Deymod15eaac2016-06-28 14:49:26 -070080Time taken for all redirect steps before the final transfer.
81See \fICURLINFO_REDIRECT_TIME(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070082.IP CURLINFO_REDIRECT_COUNT
Alex Deymod15eaac2016-06-28 14:49:26 -070083Total number of redirects that were followed.
84See \fICURLINFO_REDIRECT_COUNT(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070085.IP CURLINFO_REDIRECT_URL
Alex Deymod15eaac2016-06-28 14:49:26 -070086URL a redirect would take you to, had you enabled redirects.
87See \fICURLINFO_REDIRECT_URL(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070088.IP CURLINFO_SIZE_UPLOAD
Elliott Hughes82be86d2017-09-20 17:00:17 -070089(Deprecated) Number of bytes uploaded.
Alex Deymod15eaac2016-06-28 14:49:26 -070090See \fICURLINFO_SIZE_UPLOAD(3)\fP
Elliott Hughes82be86d2017-09-20 17:00:17 -070091.IP CURLINFO_SIZE_UPLOAD_T
92Number of bytes uploaded.
93See \fICURLINFO_SIZE_UPLOAD_T(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -070094.IP CURLINFO_SIZE_DOWNLOAD
Elliott Hughes82be86d2017-09-20 17:00:17 -070095(Deprecated) Number of bytes downloaded.
Alex Deymod15eaac2016-06-28 14:49:26 -070096See \fICURLINFO_SIZE_DOWNLOAD(3)\fP
Elliott Hughes82be86d2017-09-20 17:00:17 -070097.IP CURLINFO_SIZE_DOWNLOAD_T
98Number of bytes downloaded.
99See \fICURLINFO_SIZE_DOWNLOAD_T(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700100.IP CURLINFO_SPEED_DOWNLOAD
Elliott Hughes82be86d2017-09-20 17:00:17 -0700101(Deprecated) Average download speed.
Alex Deymod15eaac2016-06-28 14:49:26 -0700102See \fICURLINFO_SPEED_DOWNLOAD(3)\fP
Elliott Hughes82be86d2017-09-20 17:00:17 -0700103.IP CURLINFO_SPEED_DOWNLOAD_T
104Average download speed.
105See \fICURLINFO_SPEED_DOWNLOAD_T(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700106.IP CURLINFO_SPEED_UPLOAD
Elliott Hughes82be86d2017-09-20 17:00:17 -0700107(Deprecated) Average upload speed.
Alex Deymod15eaac2016-06-28 14:49:26 -0700108See \fICURLINFO_SPEED_UPLOAD(3)\fP
Elliott Hughes82be86d2017-09-20 17:00:17 -0700109.IP CURLINFO_SPEED_UPLOAD_T
110Average upload speed.
111See \fICURLINFO_SPEED_UPLOAD_T(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700112.IP CURLINFO_HEADER_SIZE
Alex Deymod15eaac2016-06-28 14:49:26 -0700113Number of bytes of all headers received.
114See \fICURLINFO_HEADER_SIZE(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700115.IP CURLINFO_REQUEST_SIZE
Alex Deymod15eaac2016-06-28 14:49:26 -0700116Number of bytes sent in the issued HTTP requests.
117See \fICURLINFO_REQUEST_SIZE(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700118.IP CURLINFO_SSL_VERIFYRESULT
Alex Deymod15eaac2016-06-28 14:49:26 -0700119Certificate verification result.
120See \fICURLINFO_SSL_VERIFYRESULT(3)\fP
Elliott Hughescee03382017-06-23 12:17:18 -0700121.IP CURLINFO_PROXY_SSL_VERIFYRESULT
122Proxy certificate verification result.
123See \fICURLINFO_PROXY_SSL_VERIFYRESULT(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700124.IP CURLINFO_SSL_ENGINES
Alex Deymod15eaac2016-06-28 14:49:26 -0700125A list of OpenSSL crypto engines.
126See \fICURLINFO_SSL_ENGINES(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700127.IP CURLINFO_CONTENT_LENGTH_DOWNLOAD
Elliott Hughes82be86d2017-09-20 17:00:17 -0700128(Deprecated) Content length from the Content-Length header.
Alex Deymod15eaac2016-06-28 14:49:26 -0700129See \fICURLINFO_CONTENT_LENGTH_DOWNLOAD(3)\fP
Elliott Hughes82be86d2017-09-20 17:00:17 -0700130.IP CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
131Content length from the Content-Length header.
132See \fICURLINFO_CONTENT_LENGTH_DOWNLOAD_T(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700133.IP CURLINFO_CONTENT_LENGTH_UPLOAD
Elliott Hughes82be86d2017-09-20 17:00:17 -0700134(Deprecated) Upload size. See \fICURLINFO_CONTENT_LENGTH_UPLOAD(3)\fP
135.IP CURLINFO_CONTENT_LENGTH_UPLOAD_T
136Upload size. See \fICURLINFO_CONTENT_LENGTH_UPLOAD_T(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700137.IP CURLINFO_CONTENT_TYPE
Alex Deymod15eaac2016-06-28 14:49:26 -0700138Content type from the Content-Type header.
139See \fICURLINFO_CONTENT_TYPE(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700140.IP CURLINFO_PRIVATE
Alex Deymod15eaac2016-06-28 14:49:26 -0700141User's private data pointer.
142See \fICURLINFO_PRIVATE(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700143.IP CURLINFO_HTTPAUTH_AVAIL
Alex Deymod15eaac2016-06-28 14:49:26 -0700144Available HTTP authentication methods.
145See \fICURLINFO_HTTPAUTH_AVAIL(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700146.IP CURLINFO_PROXYAUTH_AVAIL
Alex Deymod15eaac2016-06-28 14:49:26 -0700147Available HTTP proxy authentication methods.
148See \fICURLINFO_PROXYAUTH_AVAIL(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700149.IP CURLINFO_OS_ERRNO
Alex Deymod15eaac2016-06-28 14:49:26 -0700150The errno from the last failure to connect.
151See \fICURLINFO_OS_ERRNO(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700152.IP CURLINFO_NUM_CONNECTS
Alex Deymod15eaac2016-06-28 14:49:26 -0700153Number of new successful connections used for previous transfer.
154See \fICURLINFO_NUM_CONNECTS(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700155.IP CURLINFO_PRIMARY_IP
Alex Deymod15eaac2016-06-28 14:49:26 -0700156IP address of the last connection.
157See \fICURLINFO_PRIMARY_IP(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700158.IP CURLINFO_PRIMARY_PORT
Alex Deymod15eaac2016-06-28 14:49:26 -0700159Port of the last connection.
160See \fICURLINFO_PRIMARY_PORT(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700161.IP CURLINFO_LOCAL_IP
Alex Deymod15eaac2016-06-28 14:49:26 -0700162Local-end IP address of last connection.
163See \fICURLINFO_LOCAL_IP(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700164.IP CURLINFO_LOCAL_PORT
Alex Deymod15eaac2016-06-28 14:49:26 -0700165Local-end port of last connection.
166See \fICURLINFO_LOCAL_PORT(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700167.IP CURLINFO_COOKIELIST
Alex Deymod15eaac2016-06-28 14:49:26 -0700168List of all known cookies.
169See \fICURLINFO_COOKIELIST(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700170.IP CURLINFO_LASTSOCKET
Alex Deymod15eaac2016-06-28 14:49:26 -0700171Last socket used.
172See \fICURLINFO_LASTSOCKET(3)\fP
173.IP CURLINFO_ACTIVESOCKET
174The session's active socket.
175See \fICURLINFO_ACTIVESOCKET(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700176.IP CURLINFO_FTP_ENTRY_PATH
Alex Deymod15eaac2016-06-28 14:49:26 -0700177The entry path after logging in to an FTP server.
178See \fICURLINFO_FTP_ENTRY_PATH(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700179.IP CURLINFO_CERTINFO
Alex Deymod15eaac2016-06-28 14:49:26 -0700180Certificate chain.
181See \fICURLINFO_CERTINFO(3)\fP
182.IP CURLINFO_TLS_SSL_PTR
183TLS session info that can be used for further processing.
184See \fICURLINFO_TLS_SSL_PTR(3)\fP
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700185.IP CURLINFO_TLS_SESSION
Alex Deymod15eaac2016-06-28 14:49:26 -0700186TLS session info that can be used for further processing. See
187\fICURLINFO_TLS_SESSION(3)\fP. Deprecated option, use
188\fICURLINFO_TLS_SSL_PTR(3)\fP instead!
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700189.IP CURLINFO_CONDITION_UNMET
Alex Deymod15eaac2016-06-28 14:49:26 -0700190Whether or not a time conditional was met.
191See \fICURLINFO_CONDITION_UNMET(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700192.IP CURLINFO_RTSP_SESSION_ID
Alex Deymod15eaac2016-06-28 14:49:26 -0700193RTSP session ID.
194See \fICURLINFO_RTSP_SESSION_ID(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700195.IP CURLINFO_RTSP_CLIENT_CSEQ
Alex Deymod15eaac2016-06-28 14:49:26 -0700196RTSP CSeq that will next be used.
197See \fICURLINFO_RTSP_CLIENT_CSEQ(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700198.IP CURLINFO_RTSP_SERVER_CSEQ
Alex Deymod15eaac2016-06-28 14:49:26 -0700199RTSP CSeq that will next be expected.
200See \fICURLINFO_RTSP_SERVER_CSEQ(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700201.IP CURLINFO_RTSP_CSEQ_RECV
Alex Deymod15eaac2016-06-28 14:49:26 -0700202RTSP CSeq last received.
203See \fICURLINFO_RTSP_CSEQ_RECV(3)\fP
Elliott Hughescee03382017-06-23 12:17:18 -0700204.IP CURLINFO_PROTOCOL
205The protocol used for the connection. (Added in 7.52.0)
206See \fICURLINFO_PROTOCOL(3)\fP
207.IP CURLINFO_SCHEME
208The scheme used for the connection. (Added in 7.52.0)
209See \fICURLINFO_SCHEME(3)\fP
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700210.SH TIMES
211.nf
212An overview of the six time values available from curl_easy_getinfo()
213
214curl_easy_perform()
215 |
216 |--NAMELOOKUP
217 |--|--CONNECT
218 |--|--|--APPCONNECT
219 |--|--|--|--PRETRANSFER
220 |--|--|--|--|--STARTTRANSFER
221 |--|--|--|--|--|--TOTAL
222 |--|--|--|--|--|--REDIRECT
223.fi
224.IP NAMELOOKUP
225\fICURLINFO_NAMELOOKUP_TIME\fP. The time it took from the start until the name
226resolving was completed.
227.IP CONNECT
228\fICURLINFO_CONNECT_TIME\fP. The time it took from the start until the connect
229to the remote host (or proxy) was completed.
230.IP APPCONNECT
231\fICURLINFO_APPCONNECT_TIME\fP. The time it took from the start until the SSL
232connect/handshake with the remote host was completed. (Added in in 7.19.0)
233.IP PRETRANSFER
234\fICURLINFO_PRETRANSFER_TIME\fP. The time it took from the start until the
235file transfer is just about to begin. This includes all pre-transfer commands
236and negotiations that are specific to the particular protocol(s) involved.
237.IP STARTTRANSFER
238\fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700239first byte is received by libcurl.
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700240.IP TOTAL
241\fICURLINFO_TOTAL_TIME\fP. Total time of the previous request.
242.IP REDIRECT
243\fICURLINFO_REDIRECT_TIME\fP. The time it took for all redirection steps
244include name lookup, connect, pretransfer and transfer before final
245transaction was started. So, this is zero if no redirection took place.
246.SH RETURN VALUE
247If the operation was successful, CURLE_OK is returned. Otherwise an
248appropriate error code will be returned.
249.SH "SEE ALSO"
250.BR curl_easy_setopt "(3)"