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

TIMES

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

RETURN VALUE

323       If the operation was successful, CURLE_OK is returned. Otherwise an ap‐
324       propriate error code will be returned.
325

SEE ALSO

327       curl_easy_setopt(3)
328
329
330
331libcurl 7.76.1                 February 19, 2021          curl_easy_getinfo(3)
Impressum