Artifactspublic-v0

curl

master
ply4 git calls148 ms290 KiB2 cachedprotocol v2
447 lines11 KiBRaw

NAME

curl_easy_getinfo - extract information from a curl handle

SYNOPSIS

c
#include <curl/curl.h>

CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);

DESCRIPTION

Get the info kept in the curl handle. The third argument MUST be pointing to the specific type of the used option which is documented in each man page of the info option. The data is stored accordingly and can be relied upon only if this function returns CURLE_OK. Use this function after a performed transfer if you want to get transfer related data.

You should not free the memory returned by this function unless it is explicitly mentioned below.

OPTIONS

The following information can be extracted:

CURLINFO_ACTIVESOCKET

The session's active socket. See CURLINFO_ACTIVESOCKET(3)

CURLINFO_APPCONNECT_TIME

The time it took from the start until the SSL connect/handshake with the remote host was completed as a double in number of seconds.

CURLINFO_APPCONNECT_TIME_T

The time it took from the start until the SSL connect/handshake with the remote host was completed in number of microseconds. (Added in 7.60.0) See CURLINFO_APPCONNECT_TIME_T(3)

CURLINFO_CAINFO

Get the default value for CURLOPT_CAINFO(3). See CURLINFO_CAINFO(3)

CURLINFO_CAPATH

Get the default value for CURLOPT_CAPATH(3). See CURLINFO_CAPATH(3)

CURLINFO_CERTINFO

Certificate chain. See CURLINFO_CERTINFO(3)

CURLINFO_CONDITION_UNMET

Whether or not a time conditional was met or 304 HTTP response. See CURLINFO_CONDITION_UNMET(3)

CURLINFO_CONNECT_TIME

The time it took from the start until the connect to the remote host (or proxy) was completed. As a double. See CURLINFO_CONNECT_TIME(3)

CURLINFO_CONNECT_TIME_T

The time it took from the start until the connect to the remote host (or proxy) was completed. In microseconds. See CURLINFO_CONNECT_TIME_T(3).

CURLINFO_CONN_ID

The ID of the last connection used by the transfer. (Added in 8.2.0) See CURLINFO_CONN_ID(3)

CURLINFO_CONTENT_LENGTH_DOWNLOAD

(Deprecated) Content length from the Content-Length header. See CURLINFO_CONTENT_LENGTH_DOWNLOAD(3)

CURLINFO_CONTENT_LENGTH_DOWNLOAD_T

Content length from the Content-Length header. See CURLINFO_CONTENT_LENGTH_DOWNLOAD_T(3)

CURLINFO_CONTENT_LENGTH_UPLOAD

(Deprecated) Upload size. See CURLINFO_CONTENT_LENGTH_UPLOAD(3)

CURLINFO_CONTENT_LENGTH_UPLOAD_T

Upload size. See CURLINFO_CONTENT_LENGTH_UPLOAD_T(3)

CURLINFO_CONTENT_TYPE

Content type from the Content-Type: header. We recommend using curl_easy_header(3) instead. See CURLINFO_CONTENT_TYPE(3)

CURLINFO_COOKIELIST

List of all known cookies. See CURLINFO_COOKIELIST(3)

CURLINFO_EARLYDATA_SENT_T

Amount of TLS early data sent (in number of bytes) when CURLSSLOPT_EARLYDATA is enabled.

CURLINFO_EFFECTIVE_METHOD

Last used HTTP method. See CURLINFO_EFFECTIVE_METHOD(3)

CURLINFO_EFFECTIVE_URL

Last used URL. See CURLINFO_EFFECTIVE_URL(3)

CURLINFO_FILETIME

Remote time of the retrieved document. See CURLINFO_FILETIME(3)

CURLINFO_FILETIME_T

Remote time of the retrieved document. See CURLINFO_FILETIME_T(3)

CURLINFO_FTP_ENTRY_PATH

The entry path after logging in to an FTP server. See CURLINFO_FTP_ENTRY_PATH(3)

CURLINFO_HEADER_SIZE

Number of bytes of all headers received. See CURLINFO_HEADER_SIZE(3)

CURLINFO_HTTPAUTH_AVAIL

Available HTTP authentication methods. See CURLINFO_HTTPAUTH_AVAIL(3)

CURLINFO_HTTPAUTH_USED

Used HTTP authentication method. See CURLINFO_HTTPAUTH_USED(3)

CURLINFO_HTTP_CONNECTCODE

Last proxy CONNECT response code. See CURLINFO_HTTP_CONNECTCODE(3)

CURLINFO_HTTP_VERSION

The http version used in the connection. See CURLINFO_HTTP_VERSION(3)

CURLINFO_LASTSOCKET

(Deprecated) Last socket used. See CURLINFO_LASTSOCKET(3)

CURLINFO_LOCAL_IP

Source IP address of the last connection. See CURLINFO_LOCAL_IP(3)

CURLINFO_LOCAL_PORT

Source port number of the last connection. See CURLINFO_LOCAL_PORT(3)

CURLINFO_NAMELOOKUP_TIME

Time from start until name resolving completed as a double. See CURLINFO_NAMELOOKUP_TIME(3)

CURLINFO_NAMELOOKUP_TIME_T

Time from start until name resolving completed in number of microseconds. See CURLINFO_NAMELOOKUP_TIME_T(3)

CURLINFO_NUM_CONNECTS

Number of new successful connections used for previous transfer. See CURLINFO_NUM_CONNECTS(3)

CURLINFO_OS_ERRNO

The errno from the last failure to connect. See CURLINFO_OS_ERRNO(3)

CURLINFO_POSTTRANSFER_TIME_T

The time it took from the start until the last byte is sent by libcurl. In microseconds. (Added in 8.10.0) See CURLINFO_POSTTRANSFER_TIME_T(3)

CURLINFO_PRETRANSFER_TIME

The time it took from the start until the file transfer is about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. See CURLINFO_PRETRANSFER_TIME(3)

CURLINFO_PRETRANSFER_TIME_T

The time it took from the start until the file transfer is about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. In microseconds. See CURLINFO_PRETRANSFER_TIME_T(3)

CURLINFO_PRIMARY_IP

Destination IP address of the last connection. See CURLINFO_PRIMARY_IP(3)

CURLINFO_PRIMARY_PORT

Destination port of the last connection. See CURLINFO_PRIMARY_PORT(3)

CURLINFO_PRIVATE

User's private data pointer. See CURLINFO_PRIVATE(3)

CURLINFO_PROTOCOL

(Deprecated) The protocol used for the connection. See CURLINFO_PROTOCOL(3)

CURLINFO_PROXYAUTH_AVAIL

Available HTTP proxy authentication methods. See CURLINFO_PROXYAUTH_AVAIL(3)

CURLINFO_PROXYAUTH_USED

Used HTTP proxy authentication methods. See CURLINFO_PROXYAUTH_USED(3)

CURLINFO_PROXY_ERROR

Detailed proxy error. See CURLINFO_PROXY_ERROR(3)

CURLINFO_PROXY_SSL_VERIFYRESULT

Proxy certificate verification result. See CURLINFO_PROXY_SSL_VERIFYRESULT(3)

CURLINFO_QUEUE_TIME_T

The time during which the transfer was held in a waiting queue before it could start for real in number of microseconds. (Added in 8.6.0) See CURLINFO_QUEUE_TIME_T(3)

CURLINFO_REDIRECT_COUNT

Total number of redirects that were followed. See CURLINFO_REDIRECT_COUNT(3)

CURLINFO_REDIRECT_TIME

The time it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. This is zero if no redirection took place. As a double. See CURLINFO_REDIRECT_TIME(3)

CURLINFO_REDIRECT_TIME_T

The time it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. This is zero if no redirection took place. In number of microseconds. See CURLINFO_REDIRECT_TIME_T(3)

CURLINFO_REDIRECT_URL

URL a redirect would take you to, had you enabled redirects. See CURLINFO_REDIRECT_URL(3)

CURLINFO_REFERER

Referrer header. See CURLINFO_REFERER(3)

CURLINFO_REQUEST_SIZE

Number of bytes sent in the issued HTTP requests. See CURLINFO_REQUEST_SIZE(3)

CURLINFO_RESPONSE_CODE

Last received response code. See CURLINFO_RESPONSE_CODE(3)

CURLINFO_RETRY_AFTER

The value from the Retry-After header. See CURLINFO_RETRY_AFTER(3)

CURLINFO_RTSP_CLIENT_CSEQ

The RTSP client CSeq that is expected next. See CURLINFO_RTSP_CLIENT_CSEQ(3)

CURLINFO_RTSP_CSEQ_RECV

RTSP CSeq last received. See CURLINFO_RTSP_CSEQ_RECV(3)

CURLINFO_RTSP_SERVER_CSEQ

The RTSP server CSeq that is expected next. See CURLINFO_RTSP_SERVER_CSEQ(3)

CURLINFO_RTSP_SESSION_ID

RTSP session ID. See CURLINFO_RTSP_SESSION_ID(3)

CURLINFO_SCHEME

The scheme used for the connection. See CURLINFO_SCHEME(3)

CURLINFO_SIZE_DELIVERED

Number of bytes passed to the write callback. See CURLINFO_SIZE_DELIVERED(3)

CURLINFO_SIZE_DOWNLOAD

(Deprecated) Number of bytes downloaded. See CURLINFO_SIZE_DOWNLOAD(3)

CURLINFO_SIZE_DOWNLOAD_T

Number of bytes downloaded. See CURLINFO_SIZE_DOWNLOAD_T(3)

CURLINFO_SIZE_UPLOAD

(Deprecated) Number of bytes uploaded. See CURLINFO_SIZE_UPLOAD(3)

CURLINFO_SIZE_UPLOAD_T

Number of bytes uploaded. See CURLINFO_SIZE_UPLOAD_T(3)

CURLINFO_SPEED_DOWNLOAD

(Deprecated) Average download speed. See CURLINFO_SPEED_DOWNLOAD(3)

CURLINFO_SPEED_DOWNLOAD_T

Average download speed. See CURLINFO_SPEED_DOWNLOAD_T(3)

CURLINFO_SPEED_UPLOAD

(Deprecated) Average upload speed. See CURLINFO_SPEED_UPLOAD(3)

CURLINFO_SPEED_UPLOAD_T

Average upload speed in number of bytes per second. See CURLINFO_SPEED_UPLOAD_T(3)

CURLINFO_SSL_ENGINES

A list of OpenSSL crypto engines. See CURLINFO_SSL_ENGINES(3)

CURLINFO_SSL_VERIFYRESULT

Certificate verification result. See CURLINFO_SSL_VERIFYRESULT(3)

CURLINFO_STARTTRANSFER_TIME

The time it took from the start until the first byte is received by libcurl. As a double. See CURLINFO_STARTTRANSFER_TIME(3)

CURLINFO_STARTTRANSFER_TIME_T

The time it took from the start until the first byte is received by libcurl. In microseconds. See CURLINFO_STARTTRANSFER_TIME_T(3)

CURLINFO_TLS_SESSION

(Deprecated) TLS session info that can be used for further processing. See CURLINFO_TLS_SESSION(3). Use CURLINFO_TLS_SSL_PTR(3) instead.

CURLINFO_TLS_SSL_PTR

TLS session info that can be used for further processing. See CURLINFO_TLS_SSL_PTR(3)

CURLINFO_TOTAL_TIME

Total time of previous transfer. See CURLINFO_TOTAL_TIME(3)

CURLINFO_TOTAL_TIME_T

Total time of previous transfer. See CURLINFO_TOTAL_TIME_T(3)

CURLINFO_USED_PROXY

Whether the proxy was used (Added in 8.7.0). See CURLINFO_USED_PROXY(3)

CURLINFO_XFER_ID

The ID of the transfer. (Added in 8.2.0) See CURLINFO_XFER_ID(3)

TIMES

An overview of the time values available from curl_easy_getinfo(3)

curl_easy_perform()
    |
    |--QUEUE
    |--|--NAMELOOKUP
    |--|--|--CONNECT
    |--|--|--|--APPCONNECT
    |--|--|--|--|--PRETRANSFER
    |--|--|--|--|--|--POSTTRANSFER
    |--|--|--|--|--|--|--STARTTRANSFER
    |--|--|--|--|--|--|--|--TOTAL
    |--|--|--|--|--|--|--|--REDIRECT

CURLINFO_QUEUE_TIME_T(3), CURLINFO_NAMELOOKUP_TIME_T(3), CURLINFO_CONNECT_TIME_T(3), CURLINFO_APPCONNECT_TIME_T(3), CURLINFO_PRETRANSFER_TIME_T(3), CURLINFO_POSTTRANSFER_TIME_T(3), CURLINFO_STARTTRANSFER_TIME_T(3), CURLINFO_TOTAL_TIME_T(3), CURLINFO_REDIRECT_TIME_T(3)

%PROTOCOLS%

EXAMPLE

c
int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
    result = curl_easy_perform(curl);

    if(result == CURLE_OK) {
      char *ct;
      /* ask for the content-type */
      result = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);

      if((result == CURLE_OK) && ct)
        printf("We received Content-Type: %s\n", ct);
    }

    /* always cleanup */
    curl_easy_cleanup(curl);
  }
}

%AVAILABILITY%

RETURN VALUE

This function returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3) there can be an error message stored in the error buffer when non-zero is returned.

1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: curl_easy_getinfo
5Section: 3
6Source: libcurl
7See-also:
8 - curl_easy_setopt (3)
9Protocol:
10 - All
11Added-in: 7.4.1
12---
14# NAME
16curl_easy_getinfo - extract information from a curl handle
18# SYNOPSIS
20~~~c
21#include <curl/curl.h>
23CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
24~~~
26# DESCRIPTION
28Get the *info* kept in the *curl* handle. The third argument **MUST** be
29pointing to the specific type of the used option which is documented in each
30man page of the *info* option. The data is stored accordingly and can be
31relied upon only if this function returns CURLE_OK. Use this function after a
32performed transfer if you want to get transfer related data.
34You should not free the memory returned by this function unless it is
35explicitly mentioned below.
37# OPTIONS
39The following information can be extracted:
41## CURLINFO_ACTIVESOCKET
43The session's active socket. See CURLINFO_ACTIVESOCKET(3)
45## CURLINFO_APPCONNECT_TIME
47The time it took from the start until the SSL connect/handshake with the
48remote host was completed as a double in number of seconds.
50## CURLINFO_APPCONNECT_TIME_T
52The time it took from the start until the SSL connect/handshake with the
53remote host was completed in number of microseconds. (Added in 7.60.0) See
54CURLINFO_APPCONNECT_TIME_T(3)
56## CURLINFO_CAINFO
58Get the default value for CURLOPT_CAINFO(3). See CURLINFO_CAINFO(3)
60## CURLINFO_CAPATH
62Get the default value for CURLOPT_CAPATH(3). See CURLINFO_CAPATH(3)
64## CURLINFO_CERTINFO
66Certificate chain. See CURLINFO_CERTINFO(3)
68## CURLINFO_CONDITION_UNMET
70Whether or not a time conditional was met or 304 HTTP response.
71See CURLINFO_CONDITION_UNMET(3)
73## CURLINFO_CONNECT_TIME
75The time it took from the start until the connect to the remote host (or
76proxy) was completed. As a double. See CURLINFO_CONNECT_TIME(3)
78## CURLINFO_CONNECT_TIME_T
80The time it took from the start until the connect to the remote host (or
81proxy) was completed. In microseconds. See CURLINFO_CONNECT_TIME_T(3).
83## CURLINFO_CONN_ID
85The ID of the last connection used by the transfer. (Added in 8.2.0)
86See CURLINFO_CONN_ID(3)
88## CURLINFO_CONTENT_LENGTH_DOWNLOAD
90(**Deprecated**) Content length from the Content-Length header.
91See CURLINFO_CONTENT_LENGTH_DOWNLOAD(3)
93## CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
95Content length from the Content-Length header.
96See CURLINFO_CONTENT_LENGTH_DOWNLOAD_T(3)
98## CURLINFO_CONTENT_LENGTH_UPLOAD
100(**Deprecated**) Upload size. See CURLINFO_CONTENT_LENGTH_UPLOAD(3)
102## CURLINFO_CONTENT_LENGTH_UPLOAD_T
104Upload size. See CURLINFO_CONTENT_LENGTH_UPLOAD_T(3)
106## CURLINFO_CONTENT_TYPE
108Content type from the `Content-Type:` header. We recommend using
109curl_easy_header(3) instead. See CURLINFO_CONTENT_TYPE(3)
111## CURLINFO_COOKIELIST
113List of all known cookies. See CURLINFO_COOKIELIST(3)
115## CURLINFO_EARLYDATA_SENT_T
117Amount of TLS early data sent (in number of bytes) when
118CURLSSLOPT_EARLYDATA is enabled.
120## CURLINFO_EFFECTIVE_METHOD
122Last used HTTP method. See CURLINFO_EFFECTIVE_METHOD(3)
124## CURLINFO_EFFECTIVE_URL
126Last used URL. See CURLINFO_EFFECTIVE_URL(3)
128## CURLINFO_FILETIME
130Remote time of the retrieved document. See CURLINFO_FILETIME(3)
132## CURLINFO_FILETIME_T
134Remote time of the retrieved document. See CURLINFO_FILETIME_T(3)
136## CURLINFO_FTP_ENTRY_PATH
138The entry path after logging in to an FTP server. See
139CURLINFO_FTP_ENTRY_PATH(3)
141## CURLINFO_HEADER_SIZE
143Number of bytes of all headers received. See CURLINFO_HEADER_SIZE(3)
145## CURLINFO_HTTPAUTH_AVAIL
147Available HTTP authentication methods. See CURLINFO_HTTPAUTH_AVAIL(3)
149## CURLINFO_HTTPAUTH_USED
151Used HTTP authentication method. See CURLINFO_HTTPAUTH_USED(3)
153## CURLINFO_HTTP_CONNECTCODE
155Last proxy CONNECT response code. See CURLINFO_HTTP_CONNECTCODE(3)
157## CURLINFO_HTTP_VERSION
159The http version used in the connection. See CURLINFO_HTTP_VERSION(3)
161## CURLINFO_LASTSOCKET
163(**Deprecated**) Last socket used. See CURLINFO_LASTSOCKET(3)
165## CURLINFO_LOCAL_IP
167Source IP address of the last connection. See CURLINFO_LOCAL_IP(3)
169## CURLINFO_LOCAL_PORT
171Source port number of the last connection. See CURLINFO_LOCAL_PORT(3)
173## CURLINFO_NAMELOOKUP_TIME
175Time from start until name resolving completed as a double. See
176CURLINFO_NAMELOOKUP_TIME(3)
178## CURLINFO_NAMELOOKUP_TIME_T
180Time from start until name resolving completed in number of microseconds. See
181CURLINFO_NAMELOOKUP_TIME_T(3)
183## CURLINFO_NUM_CONNECTS
185Number of new successful connections used for previous transfer.
186See CURLINFO_NUM_CONNECTS(3)
188## CURLINFO_OS_ERRNO
190The errno from the last failure to connect. See CURLINFO_OS_ERRNO(3)
192## CURLINFO_POSTTRANSFER_TIME_T
194The time it took from the start until the last byte is sent by libcurl.
195In microseconds. (Added in 8.10.0) See CURLINFO_POSTTRANSFER_TIME_T(3)
197## CURLINFO_PRETRANSFER_TIME
199The time it took from the start until the file transfer is about to begin.
200This includes all pre-transfer commands and negotiations that are specific to
201the particular protocol(s) involved. See CURLINFO_PRETRANSFER_TIME(3)
203## CURLINFO_PRETRANSFER_TIME_T
205The time it took from the start until the file transfer is about to begin.
206This includes all pre-transfer commands and negotiations that are specific to
207the particular protocol(s) involved. In microseconds. See
208CURLINFO_PRETRANSFER_TIME_T(3)
210## CURLINFO_PRIMARY_IP
212Destination IP address of the last connection. See CURLINFO_PRIMARY_IP(3)
214## CURLINFO_PRIMARY_PORT
216Destination port of the last connection. See CURLINFO_PRIMARY_PORT(3)
218## CURLINFO_PRIVATE
220User's private data pointer. See CURLINFO_PRIVATE(3)
222## CURLINFO_PROTOCOL
224(**Deprecated**) The protocol used for the connection. See
225CURLINFO_PROTOCOL(3)
227## CURLINFO_PROXYAUTH_AVAIL
229Available HTTP proxy authentication methods. See CURLINFO_PROXYAUTH_AVAIL(3)
231## CURLINFO_PROXYAUTH_USED
233Used HTTP proxy authentication methods. See CURLINFO_PROXYAUTH_USED(3)
235## CURLINFO_PROXY_ERROR
237Detailed proxy error. See CURLINFO_PROXY_ERROR(3)
239## CURLINFO_PROXY_SSL_VERIFYRESULT
241Proxy certificate verification result. See CURLINFO_PROXY_SSL_VERIFYRESULT(3)
243## CURLINFO_QUEUE_TIME_T
245The time during which the transfer was held in a waiting queue before it could
246start for real in number of microseconds. (Added in 8.6.0) See
247CURLINFO_QUEUE_TIME_T(3)
249## CURLINFO_REDIRECT_COUNT
251Total number of redirects that were followed. See CURLINFO_REDIRECT_COUNT(3)
253## CURLINFO_REDIRECT_TIME
255The time it took for all redirection steps include name lookup, connect,
256pretransfer and transfer before final transaction was started. This is zero if
257no redirection took place. As a double. See CURLINFO_REDIRECT_TIME(3)
259## CURLINFO_REDIRECT_TIME_T
261The time it took for all redirection steps include name lookup, connect,
262pretransfer and transfer before final transaction was started. This is zero if
263no redirection took place. In number of microseconds. See
264CURLINFO_REDIRECT_TIME_T(3)
266## CURLINFO_REDIRECT_URL
268URL a redirect would take you to, had you enabled redirects. See
269CURLINFO_REDIRECT_URL(3)
271## CURLINFO_REFERER
273Referrer header. See CURLINFO_REFERER(3)
275## CURLINFO_REQUEST_SIZE
277Number of bytes sent in the issued HTTP requests. See CURLINFO_REQUEST_SIZE(3)
279## CURLINFO_RESPONSE_CODE
281Last received response code. See CURLINFO_RESPONSE_CODE(3)
283## CURLINFO_RETRY_AFTER
285The value from the Retry-After header. See CURLINFO_RETRY_AFTER(3)
287## CURLINFO_RTSP_CLIENT_CSEQ
289The RTSP client CSeq that is expected next. See CURLINFO_RTSP_CLIENT_CSEQ(3)
291## CURLINFO_RTSP_CSEQ_RECV
293RTSP CSeq last received. See CURLINFO_RTSP_CSEQ_RECV(3)
295## CURLINFO_RTSP_SERVER_CSEQ
297The RTSP server CSeq that is expected next. See CURLINFO_RTSP_SERVER_CSEQ(3)
299## CURLINFO_RTSP_SESSION_ID
301RTSP session ID. See CURLINFO_RTSP_SESSION_ID(3)
303## CURLINFO_SCHEME
305The scheme used for the connection. See CURLINFO_SCHEME(3)
307## CURLINFO_SIZE_DELIVERED
309Number of bytes passed to the write callback. See CURLINFO_SIZE_DELIVERED(3)
311## CURLINFO_SIZE_DOWNLOAD
313(**Deprecated**) Number of bytes downloaded. See CURLINFO_SIZE_DOWNLOAD(3)
315## CURLINFO_SIZE_DOWNLOAD_T
317Number of bytes downloaded. See CURLINFO_SIZE_DOWNLOAD_T(3)
319## CURLINFO_SIZE_UPLOAD
321(**Deprecated**) Number of bytes uploaded. See CURLINFO_SIZE_UPLOAD(3)
323## CURLINFO_SIZE_UPLOAD_T
325Number of bytes uploaded. See CURLINFO_SIZE_UPLOAD_T(3)
327## CURLINFO_SPEED_DOWNLOAD
329(**Deprecated**) Average download speed. See CURLINFO_SPEED_DOWNLOAD(3)
331## CURLINFO_SPEED_DOWNLOAD_T
333Average download speed. See CURLINFO_SPEED_DOWNLOAD_T(3)
335## CURLINFO_SPEED_UPLOAD
337(**Deprecated**) Average upload speed. See CURLINFO_SPEED_UPLOAD(3)
339## CURLINFO_SPEED_UPLOAD_T
341Average upload speed in number of bytes per second. See
342CURLINFO_SPEED_UPLOAD_T(3)
344## CURLINFO_SSL_ENGINES
346A list of OpenSSL crypto engines. See CURLINFO_SSL_ENGINES(3)
348## CURLINFO_SSL_VERIFYRESULT
350Certificate verification result. See CURLINFO_SSL_VERIFYRESULT(3)
352## CURLINFO_STARTTRANSFER_TIME
354The time it took from the start until the first byte is received by libcurl.
355As a double. See CURLINFO_STARTTRANSFER_TIME(3)
357## CURLINFO_STARTTRANSFER_TIME_T
359The time it took from the start until the first byte is received by libcurl.
360In microseconds. See CURLINFO_STARTTRANSFER_TIME_T(3)
362## CURLINFO_TLS_SESSION
364(**Deprecated**) TLS session info that can be used for further processing. See
365CURLINFO_TLS_SESSION(3). Use CURLINFO_TLS_SSL_PTR(3) instead.
367## CURLINFO_TLS_SSL_PTR
369TLS session info that can be used for further processing. See
370CURLINFO_TLS_SSL_PTR(3)
372## CURLINFO_TOTAL_TIME
374Total time of previous transfer. See CURLINFO_TOTAL_TIME(3)
376## CURLINFO_TOTAL_TIME_T
378Total time of previous transfer. See CURLINFO_TOTAL_TIME_T(3)
380## CURLINFO_USED_PROXY
382Whether the proxy was used (Added in 8.7.0). See CURLINFO_USED_PROXY(3)
384## CURLINFO_XFER_ID
386The ID of the transfer. (Added in 8.2.0) See CURLINFO_XFER_ID(3)
388# TIMES
390An overview of the time values available from curl_easy_getinfo(3)
392 curl_easy_perform()
393 |
394 |--QUEUE
395 |--|--NAMELOOKUP
396 |--|--|--CONNECT
397 |--|--|--|--APPCONNECT
398 |--|--|--|--|--PRETRANSFER
399 |--|--|--|--|--|--POSTTRANSFER
400 |--|--|--|--|--|--|--STARTTRANSFER
401 |--|--|--|--|--|--|--|--TOTAL
402 |--|--|--|--|--|--|--|--REDIRECT
404CURLINFO_QUEUE_TIME_T(3), CURLINFO_NAMELOOKUP_TIME_T(3),
405CURLINFO_CONNECT_TIME_T(3), CURLINFO_APPCONNECT_TIME_T(3),
406CURLINFO_PRETRANSFER_TIME_T(3), CURLINFO_POSTTRANSFER_TIME_T(3),
407CURLINFO_STARTTRANSFER_TIME_T(3), CURLINFO_TOTAL_TIME_T(3),
408CURLINFO_REDIRECT_TIME_T(3)
410# %PROTOCOLS%
412# EXAMPLE
414~~~c
415int main(void)
417 CURL *curl = curl_easy_init();
418 if(curl) {
419 CURLcode result;
420 curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
421 result = curl_easy_perform(curl);
423 if(result == CURLE_OK) {
424 char *ct;
425 /* ask for the content-type */
426 result = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
428 if((result == CURLE_OK) && ct)
429 printf("We received Content-Type: %s\n", ct);
430 }
432 /* always cleanup */
433 curl_easy_cleanup(curl);
434 }
436~~~
438# %AVAILABILITY%
440# RETURN VALUE
442This function returns a CURLcode indicating success or error.
444CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
445libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
446there can be an error message stored in the error buffer when non-zero is
447returned.
Diagnostics4 git calls · 148 ms
CallStatusSizeTime0148 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit6 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=139
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=6
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2003.5 KiB139 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=3591
git.response.cache=MISS
git.response.duration_ms=139
git.fetch.wants=6fc5555b38e69c9f3b8c8a2c04dac1a530efd9e3
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=3591
git.pkt.payload.max=3570
git.sideband.band1.bytes=3569
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e35d91c9b75cd4
Request
69093cfc…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format