1curl_easy_getinfo(3)            libcurl Manual            curl_easy_getinfo(3)
2
3
4

NAME

6       curl_easy_getinfo - extract information from a curl handle
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );
12
13

DESCRIPTION

15       Request  internal information from the curl session with this function.
16       The third argument MUST be a pointer to a long, a pointer to a char  *,
17       a  pointer  to  a struct curl_slist * or a pointer to a double (as this
18       documentation describes further down).  The  data  pointed-to  will  be
19       filled  in  accordingly  and  can  be  relied upon only if the function
20       returns CURLE_OK.  Use this function AFTER a performed transfer if  you
21       want to get transfer related data.
22
23       You  should  not free the memory returned by this function unless it is
24       explicitly mentioned below.
25

AVAILABLE INFORMATION

27       The following information can be extracted:
28
29       CURLINFO_EFFECTIVE_URL
30              Last used URL.  See CURLINFO_EFFECTIVE_URL(3)
31
32       CURLINFO_RESPONSE_CODE
33              Last received response code.  See CURLINFO_RESPONSE_CODE(3)
34
35       CURLINFO_HTTP_CONNECTCODE
36              Last proxy CONNECT response  code.   See  CURLINFO_HTTP_CONNECT‐
37              CODE(3)
38
39       CURLINFO_HTTP_VERSION
40              The http version used in the connection.  See CURLINFO_HTTP_VER‐
41              SION(3)
42
43       CURLINFO_FILETIME
44              Remote time of the retrieved document. See CURLINFO_FILETIME(3)
45
46       CURLINFO_FILETIME_T
47              Remote  time  of  the  retrieved  document.  See  CURLINFO_FILE‐
48              TIME_T(3)
49
50       CURLINFO_TOTAL_TIME
51              Total time of previous transfer.  See CURLINFO_TOTAL_TIME(3)
52
53       CURLINFO_TOTAL_TIME_T
54              Total time of previous transfer.  See CURLINFO_TOTAL_TIME_T(3)
55
56       CURLINFO_NAMELOOKUP_TIME
57              Time   from   start   until   name   resolving  completed.   See
58              CURLINFO_NAMELOOKUP_TIME(3)
59
60       CURLINFO_NAMELOOKUP_TIME_T
61              Time  from  start   until   name   resolving   completed.    See
62              CURLINFO_NAMELOOKUP_TIME_T(3)
63
64       CURLINFO_CONNECT_TIME
65              Time  from  start  until  remote  host  or proxy completed.  See
66              CURLINFO_CONNECT_TIME(3)
67
68       CURLINFO_CONNECT_TIME_T
69              Time from start until  remote  host  or  proxy  completed.   See
70              CURLINFO_CONNECT_TIME_T(3)
71
72       CURLINFO_APPCONNECT_TIME
73              Time   from   start  until  SSL/SSH  handshake  completed.   See
74              CURLINFO_APPCONNECT_TIME(3)
75
76       CURLINFO_APPCONNECT_TIME_T
77              Time  from  start  until  SSL/SSH  handshake   completed.    See
78              CURLINFO_APPCONNECT_TIME_T(3)
79
80       CURLINFO_PRETRANSFER_TIME
81              Time  from  start  until  just  before the transfer begins.  See
82              CURLINFO_PRETRANSFER_TIME(3)
83
84       CURLINFO_PRETRANSFER_TIME_T
85              Time from start until just  before  the  transfer  begins.   See
86              CURLINFO_PRETRANSFER_TIME_T(3)
87
88       CURLINFO_STARTTRANSFER_TIME
89              Time from start until just when the first byte is received.  See
90              CURLINFO_STARTTRANSFER_TIME(3)
91
92       CURLINFO_STARTTRANSFER_TIME_T
93              Time from start until just when the first byte is received.  See
94              CURLINFO_STARTTRANSFER_TIME_T(3)
95
96       CURLINFO_REDIRECT_TIME
97              Time  taken  for  all  redirect steps before the final transfer.
98              See CURLINFO_REDIRECT_TIME(3)
99
100       CURLINFO_REDIRECT_TIME_T
101              Time taken for all redirect steps  before  the  final  transfer.
102              See CURLINFO_REDIRECT_TIME_T(3)
103
104       CURLINFO_REDIRECT_COUNT
105              Total  number of redirects that were followed.  See CURLINFO_RE‐
106              DIRECT_COUNT(3)
107
108       CURLINFO_REDIRECT_URL
109              URL a redirect would take you to,  had  you  enabled  redirects.
110              See CURLINFO_REDIRECT_URL(3)
111
112       CURLINFO_SIZE_UPLOAD
113              (Deprecated)      Number     of     bytes     uploaded.      See
114              CURLINFO_SIZE_UPLOAD(3)
115
116       CURLINFO_SIZE_UPLOAD_T
117              Number of bytes uploaded.  See CURLINFO_SIZE_UPLOAD_T(3)
118
119       CURLINFO_SIZE_DOWNLOAD
120              (Deprecated)    Number     of     bytes     downloaded.      See
121              CURLINFO_SIZE_DOWNLOAD(3)
122
123       CURLINFO_SIZE_DOWNLOAD_T
124              Number of bytes downloaded.  See CURLINFO_SIZE_DOWNLOAD_T(3)
125
126       CURLINFO_SPEED_DOWNLOAD
127              (Deprecated)  Average  download speed.  See CURLINFO_SPEED_DOWN‐
128              LOAD(3)
129
130       CURLINFO_SPEED_DOWNLOAD_T
131              Average download speed.  See CURLINFO_SPEED_DOWNLOAD_T(3)
132
133       CURLINFO_SPEED_UPLOAD
134              (Deprecated) Average upload speed.  See CURLINFO_SPEED_UPLOAD(3)
135
136       CURLINFO_SPEED_UPLOAD_T
137              Average upload speed.  See CURLINFO_SPEED_UPLOAD_T(3)
138
139       CURLINFO_HEADER_SIZE
140              Number   of   bytes    of    all    headers    received.     See
141              CURLINFO_HEADER_SIZE(3)
142
143       CURLINFO_REQUEST_SIZE
144              Number   of  bytes  sent  in  the  issued  HTTP  requests.   See
145              CURLINFO_REQUEST_SIZE(3)
146
147       CURLINFO_SSL_VERIFYRESULT
148              Certificate  verification  result.   See  CURLINFO_SSL_VERIFYRE‐
149              SULT(3)
150
151       CURLINFO_PROXY_SSL_VERIFYRESULT
152              Proxy       certificate      verification      result.       See
153              CURLINFO_PROXY_SSL_VERIFYRESULT(3)
154
155       CURLINFO_SSL_ENGINES
156              A list of OpenSSL crypto engines.  See CURLINFO_SSL_ENGINES(3)
157
158       CURLINFO_CONTENT_LENGTH_DOWNLOAD
159              (Deprecated) Content length from the Content-Length header.  See
160              CURLINFO_CONTENT_LENGTH_DOWNLOAD(3)
161
162       CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
163              Content    length   from   the   Content-Length   header.    See
164              CURLINFO_CONTENT_LENGTH_DOWNLOAD_T(3)
165
166       CURLINFO_CONTENT_LENGTH_UPLOAD
167              (Deprecated) Upload size. See CURLINFO_CONTENT_LENGTH_UPLOAD(3)
168
169       CURLINFO_CONTENT_LENGTH_UPLOAD_T
170              Upload size.  See CURLINFO_CONTENT_LENGTH_UPLOAD_T(3)
171
172       CURLINFO_CONTENT_TYPE
173              Content type from the Content-Type  header.   See  CURLINFO_CON‐
174              TENT_TYPE(3)
175
176       CURLINFO_RETRY_AFTER
177              The   value   from   the   from  the  Retry-After  header.   See
178              CURLINFO_RETRY_AFTER(3)
179
180       CURLINFO_PRIVATE
181              User's private data pointer.  See CURLINFO_PRIVATE(3)
182
183       CURLINFO_HTTPAUTH_AVAIL
184              Available      HTTP      authentication      methods.        See
185              CURLINFO_HTTPAUTH_AVAIL(3)
186
187       CURLINFO_PROXYAUTH_AVAIL
188              Available HTTP proxy authentication methods.  See CURLINFO_PROX‐
189              YAUTH_AVAIL(3)
190
191       CURLINFO_OS_ERRNO
192              The   errno   from   the   last   failure   to   connect.    See
193              CURLINFO_OS_ERRNO(3)
194
195       CURLINFO_NUM_CONNECTS
196              Number of new successful connections used for previous transfer.
197              See CURLINFO_NUM_CONNECTS(3)
198
199       CURLINFO_PRIMARY_IP
200              IP address of the last connection.  See CURLINFO_PRIMARY_IP(3)
201
202       CURLINFO_PRIMARY_PORT
203              Port of the last connection.  See CURLINFO_PRIMARY_PORT(3)
204
205       CURLINFO_LOCAL_IP
206              Local-end    IP    address    of    last    connection.      See
207              CURLINFO_LOCAL_IP(3)
208
209       CURLINFO_LOCAL_PORT
210              Local-end port of last connection.  See CURLINFO_LOCAL_PORT(3)
211
212       CURLINFO_COOKIELIST
213              List of all known cookies.  See CURLINFO_COOKIELIST(3)
214
215       CURLINFO_LASTSOCKET
216              Last socket used.  See CURLINFO_LASTSOCKET(3)
217
218       CURLINFO_ACTIVESOCKET
219              The session's active socket.  See CURLINFO_ACTIVESOCKET(3)
220
221       CURLINFO_FTP_ENTRY_PATH
222              The  entry  path  after  logging  in  to  an  FTP  server.   See
223              CURLINFO_FTP_ENTRY_PATH(3)
224
225       CURLINFO_CERTINFO
226              Certificate chain.  See CURLINFO_CERTINFO(3)
227
228       CURLINFO_TLS_SSL_PTR
229              TLS session info that can be used for further  processing.   See
230              CURLINFO_TLS_SSL_PTR(3)
231
232       CURLINFO_TLS_SESSION
233              TLS  session  info that can be used for further processing.  See
234              CURLINFO_TLS_SESSION(3).      Deprecated       option,       use
235              CURLINFO_TLS_SSL_PTR(3) instead!
236
237       CURLINFO_CONDITION_UNMET
238              Whether  or not a time conditional was met or 304 HTTP response.
239              See CURLINFO_CONDITION_UNMET(3)
240
241       CURLINFO_RTSP_SESSION_ID
242              RTSP session ID.  See CURLINFO_RTSP_SESSION_ID(3)
243
244       CURLINFO_RTSP_CLIENT_CSEQ
245              RTSP    CSeq    that     will     next     be     used.      See
246              CURLINFO_RTSP_CLIENT_CSEQ(3)
247
248       CURLINFO_RTSP_SERVER_CSEQ
249              RTSP     CSeq    that    will    next    be    expected.     See
250              CURLINFO_RTSP_SERVER_CSEQ(3)
251
252       CURLINFO_RTSP_CSEQ_RECV
253              RTSP CSeq last received.  See CURLINFO_RTSP_CSEQ_RECV(3)
254
255       CURLINFO_PROTOCOL
256              The protocol used for the  connection.  (Added  in  7.52.0)  See
257              CURLINFO_PROTOCOL(3)
258
259       CURLINFO_SCHEME
260              The  scheme  used  for  the  connection.  (Added  in 7.52.0) See
261              CURLINFO_SCHEME(3)
262

TIMES

264       An overview of the six time values available from curl_easy_getinfo()
265
266       curl_easy_perform()
267           |
268           |--NAMELOOKUP
269           |--|--CONNECT
270           |--|--|--APPCONNECT
271           |--|--|--|--PRETRANSFER
272           |--|--|--|--|--STARTTRANSFER
273           |--|--|--|--|--|--TOTAL
274           |--|--|--|--|--|--REDIRECT
275
276       NAMELOOKUP
277              CURLINFO_NAMELOOKUP_TIME  and  CURLINFO_NAMELOOKUP_TIME_T.   The
278              time  it  took  from the start until the name resolving was com‐
279              pleted.
280
281       CONNECT
282              CURLINFO_CONNECT_TIME and CURLINFO_CONNECT_TIME_T.  The time  it
283              took  from  the  start  until the connect to the remote host (or
284              proxy) was completed.
285
286       APPCONNECT
287              CURLINFO_APPCONNECT_TIME  and  CURLINFO_APPCONNECT_TIME_T.   The
288              time it took from the start until the SSL connect/handshake with
289              the remote host was completed. (Added in 7.19.0) The  latter  is
290              the integer version (measuring microseconds).  (Added in 7.60.0)
291
292       PRETRANSFER
293              CURLINFO_PRETRANSFER_TIME  and CURLINFO_PRETRANSFER_TIME_T.  The
294              time it took from the start until  the  file  transfer  is  just
295              about  to  begin.  This  includes  all pre-transfer commands and
296              negotiations that are specific  to  the  particular  protocol(s)
297              involved.
298
299       STARTTRANSFER
300              CURLINFO_STARTTRANSFER_TIME  and  CURLINFO_STARTTRANSFER_TIME_T.
301              The time it took from the start until the first byte is received
302              by libcurl.
303
304       TOTAL  CURLINFO_TOTAL_TIME  and  CURLINFO_TOTAL_TIME_T.   Total time of
305              the previous request.
306
307       REDIRECT
308              CURLINFO_REDIRECT_TIME and CURLINFO_REDIRECT_TIME_T.   The  time
309              it  took for all redirection steps include name lookup, connect,
310              pretransfer and transfer before final transaction  was  started.
311              So, this is zero if no redirection took place.
312

RETURN VALUE

314       If  the  operation  was  successful, CURLE_OK is returned. Otherwise an
315       appropriate error code will be returned.
316

SEE ALSO

318       curl_easy_setopt(3)
319
320
321
322libcurl 7.71.1                  April 06, 2020            curl_easy_getinfo(3)
Impressum