curl\_easy\_getinfo(3) Library Functions Manual curl\_easy\_getinfo(3)

# [NAME](#NAME)

curl\_easy\_getinfo - extract information from a curl handle

# [SYNOPSIS](#SYNOPSIS)

```
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
```

# [DESCRIPTION](#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](#OPTIONS)

The following information can be extracted:

[CURLINFO\_ACTIVESOCKET](#CURLINFO_ACTIVESOCKET)

The session's active socket. See [*CURLINFO\_ACTIVESOCKET(3)*](/man/os/curl/CURLINFO_ACTIVESOCKET.3)

[CURLINFO\_APPCONNECT\_TIME](#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](#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)*](/man/os/curl/CURLINFO_APPCONNECT_TIME_T.3)

[CURLINFO\_CAINFO](#CURLINFO_CAINFO)

Get the default value for [*CURLOPT\_CAINFO(3)*](/man/os/curl/CURLOPT_CAINFO.3). See [*CURLINFO\_CAINFO(3)*](/man/os/curl/CURLINFO_CAINFO.3)

[CURLINFO\_CAPATH](#CURLINFO_CAPATH)

Get the default value for [*CURLOPT\_CAPATH(3)*](/man/os/curl/CURLOPT_CAPATH.3). See [*CURLINFO\_CAPATH(3)*](/man/os/curl/CURLINFO_CAPATH.3)

[CURLINFO\_CERTINFO](#CURLINFO_CERTINFO)

Certificate chain. See [*CURLINFO\_CERTINFO(3)*](/man/os/curl/CURLINFO_CERTINFO.3)

[CURLINFO\_CONDITION\_UNMET](#CURLINFO_CONDITION_UNMET)

Whether or not a time conditional was met or 304 HTTP response. See [*CURLINFO\_CONDITION\_UNMET(3)*](/man/os/curl/CURLINFO_CONDITION_UNMET.3)

[CURLINFO\_CONNECT\_TIME](#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)*](/man/os/curl/CURLINFO_CONNECT_TIME.3)

[CURLINFO\_CONNECT\_TIME\_T](#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)*](/man/os/curl/CURLINFO_CONNECT_TIME_T.3).

[CURLINFO\_CONN\_ID](#CURLINFO_CONN_ID)

The ID of the last connection used by the transfer. (Added in 8.2.0) See [*CURLINFO\_CONN\_ID(3)*](/man/os/curl/CURLINFO_CONN_ID.3)

[CURLINFO\_CONTENT\_LENGTH\_DOWNLOAD](#CURLINFO_CONTENT_LENGTH_DOWNLOAD)

(**Deprecated**) Content length from the Content-Length header. See [*CURLINFO\_CONTENT\_LENGTH\_DOWNLOAD(3)*](/man/os/curl/CURLINFO_CONTENT_LENGTH_DOWNLOAD.3)

[CURLINFO\_CONTENT\_LENGTH\_DOWNLOAD\_T](#CURLINFO_CONTENT_LENGTH_DOWNLOAD_T)

Content length from the Content-Length header. See [*CURLINFO\_CONTENT\_LENGTH\_DOWNLOAD\_T(3)*](/man/os/curl/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.3)

[CURLINFO\_CONTENT\_LENGTH\_UPLOAD](#CURLINFO_CONTENT_LENGTH_UPLOAD)

(**Deprecated**) Upload size. See [*CURLINFO\_CONTENT\_LENGTH\_UPLOAD(3)*](/man/os/curl/CURLINFO_CONTENT_LENGTH_UPLOAD.3)

[CURLINFO\_CONTENT\_LENGTH\_UPLOAD\_T](#CURLINFO_CONTENT_LENGTH_UPLOAD_T)

Upload size. See [*CURLINFO\_CONTENT\_LENGTH\_UPLOAD\_T(3)*](/man/os/curl/CURLINFO_CONTENT_LENGTH_UPLOAD_T.3)

[CURLINFO\_CONTENT\_TYPE](#CURLINFO_CONTENT_TYPE)

Content type from the *Content-Type:* header. We recommend using [*curl\_easy\_header(3)*](/man/os/curl/curl_easy_header.3) instead. See [*CURLINFO\_CONTENT\_TYPE(3)*](/man/os/curl/CURLINFO_CONTENT_TYPE.3)

[CURLINFO\_COOKIELIST](#CURLINFO_COOKIELIST)

List of all known cookies. See [*CURLINFO\_COOKIELIST(3)*](/man/os/curl/CURLINFO_COOKIELIST.3)

[CURLINFO\_EARLYDATA\_SENT\_T](#CURLINFO_EARLYDATA_SENT_T)

Amount of TLS early data sent (in number of bytes) when CURLSSLOPT\_EARLYDATA is enabled.

[CURLINFO\_EFFECTIVE\_METHOD](#CURLINFO_EFFECTIVE_METHOD)

Last used HTTP method. See [*CURLINFO\_EFFECTIVE\_METHOD(3)*](/man/os/curl/CURLINFO_EFFECTIVE_METHOD.3)

[CURLINFO\_EFFECTIVE\_URL](#CURLINFO_EFFECTIVE_URL)

Last used URL. See [*CURLINFO\_EFFECTIVE\_URL(3)*](/man/os/curl/CURLINFO_EFFECTIVE_URL.3)

[CURLINFO\_FILETIME](#CURLINFO_FILETIME)

Remote time of the retrieved document. See [*CURLINFO\_FILETIME(3)*](/man/os/curl/CURLINFO_FILETIME.3)

[CURLINFO\_FILETIME\_T](#CURLINFO_FILETIME_T)

Remote time of the retrieved document. See [*CURLINFO\_FILETIME\_T(3)*](/man/os/curl/CURLINFO_FILETIME_T.3)

[CURLINFO\_FTP\_ENTRY\_PATH](#CURLINFO_FTP_ENTRY_PATH)

The entry path after logging in to an FTP server. See [*CURLINFO\_FTP\_ENTRY\_PATH(3)*](/man/os/curl/CURLINFO_FTP_ENTRY_PATH.3)

[CURLINFO\_HEADER\_SIZE](#CURLINFO_HEADER_SIZE)

Number of bytes of all headers received. See [*CURLINFO\_HEADER\_SIZE(3)*](/man/os/curl/CURLINFO_HEADER_SIZE.3)

[CURLINFO\_HTTPAUTH\_AVAIL](#CURLINFO_HTTPAUTH_AVAIL)

Available HTTP authentication methods. See [*CURLINFO\_HTTPAUTH\_AVAIL(3)*](/man/os/curl/CURLINFO_HTTPAUTH_AVAIL.3)

[CURLINFO\_HTTPAUTH\_USED](#CURLINFO_HTTPAUTH_USED)

Used HTTP authentication method. See [*CURLINFO\_HTTPAUTH\_USED(3)*](/man/os/curl/CURLINFO_HTTPAUTH_USED.3)

[CURLINFO\_HTTP\_CONNECTCODE](#CURLINFO_HTTP_CONNECTCODE)

Last proxy CONNECT response code. See [*CURLINFO\_HTTP\_CONNECTCODE(3)*](/man/os/curl/CURLINFO_HTTP_CONNECTCODE.3)

[CURLINFO\_HTTP\_VERSION](#CURLINFO_HTTP_VERSION)

The http version used in the connection. See [*CURLINFO\_HTTP\_VERSION(3)*](/man/os/curl/CURLINFO_HTTP_VERSION.3)

[CURLINFO\_LASTSOCKET](#CURLINFO_LASTSOCKET)

(**Deprecated**) Last socket used. See [*CURLINFO\_LASTSOCKET(3)*](/man/os/curl/CURLINFO_LASTSOCKET.3)

[CURLINFO\_LOCAL\_IP](#CURLINFO_LOCAL_IP)

Source IP address of the last connection. See [*CURLINFO\_LOCAL\_IP(3)*](/man/os/curl/CURLINFO_LOCAL_IP.3)

[CURLINFO\_LOCAL\_PORT](#CURLINFO_LOCAL_PORT)

Source port number of the last connection. See [*CURLINFO\_LOCAL\_PORT(3)*](/man/os/curl/CURLINFO_LOCAL_PORT.3)

[CURLINFO\_NAMELOOKUP\_TIME](#CURLINFO_NAMELOOKUP_TIME)

Time from start until name resolving completed as a double. See [*CURLINFO\_NAMELOOKUP\_TIME(3)*](/man/os/curl/CURLINFO_NAMELOOKUP_TIME.3)

[CURLINFO\_NAMELOOKUP\_TIME\_T](#CURLINFO_NAMELOOKUP_TIME_T)

Time from start until name resolving completed in number of microseconds. See [*CURLINFO\_NAMELOOKUP\_TIME\_T(3)*](/man/os/curl/CURLINFO_NAMELOOKUP_TIME_T.3)

[CURLINFO\_NUM\_CONNECTS](#CURLINFO_NUM_CONNECTS)

Number of new successful connections used for previous transfer. See [*CURLINFO\_NUM\_CONNECTS(3)*](/man/os/curl/CURLINFO_NUM_CONNECTS.3)

[CURLINFO\_OS\_ERRNO](#CURLINFO_OS_ERRNO)

The errno from the last failure to connect. See [*CURLINFO\_OS\_ERRNO(3)*](/man/os/curl/CURLINFO_OS_ERRNO.3)

[CURLINFO\_POSTTRANSFER\_TIME\_T](#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)*](/man/os/curl/CURLINFO_POSTTRANSFER_TIME_T.3)

[CURLINFO\_PRETRANSFER\_TIME](#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)*](/man/os/curl/CURLINFO_PRETRANSFER_TIME.3)

[CURLINFO\_PRETRANSFER\_TIME\_T](#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)*](/man/os/curl/CURLINFO_PRETRANSFER_TIME_T.3)

[CURLINFO\_PRIMARY\_IP](#CURLINFO_PRIMARY_IP)

Destination IP address of the last connection. See [*CURLINFO\_PRIMARY\_IP(3)*](/man/os/curl/CURLINFO_PRIMARY_IP.3)

[CURLINFO\_PRIMARY\_PORT](#CURLINFO_PRIMARY_PORT)

Destination port of the last connection. See [*CURLINFO\_PRIMARY\_PORT(3)*](/man/os/curl/CURLINFO_PRIMARY_PORT.3)

[CURLINFO\_PRIVATE](#CURLINFO_PRIVATE)

User's private data pointer. See [*CURLINFO\_PRIVATE(3)*](/man/os/curl/CURLINFO_PRIVATE.3)

[CURLINFO\_PROTOCOL](#CURLINFO_PROTOCOL)

(**Deprecated**) The protocol used for the connection. See [*CURLINFO\_PROTOCOL(3)*](/man/os/curl/CURLINFO_PROTOCOL.3)

[CURLINFO\_PROXYAUTH\_AVAIL](#CURLINFO_PROXYAUTH_AVAIL)

Available HTTP proxy authentication methods. See [*CURLINFO\_PROXYAUTH\_AVAIL(3)*](/man/os/curl/CURLINFO_PROXYAUTH_AVAIL.3)

[CURLINFO\_PROXYAUTH\_USED](#CURLINFO_PROXYAUTH_USED)

Used HTTP proxy authentication methods. See [*CURLINFO\_PROXYAUTH\_USED(3)*](/man/os/curl/CURLINFO_PROXYAUTH_USED.3)

[CURLINFO\_PROXY\_ERROR](#CURLINFO_PROXY_ERROR)

Detailed proxy error. See [*CURLINFO\_PROXY\_ERROR(3)*](/man/os/curl/CURLINFO_PROXY_ERROR.3)

[CURLINFO\_PROXY\_SSL\_VERIFYRESULT](#CURLINFO_PROXY_SSL_VERIFYRESULT)

Proxy certificate verification result. See [*CURLINFO\_PROXY\_SSL\_VERIFYRESULT(3)*](/man/os/curl/CURLINFO_PROXY_SSL_VERIFYRESULT.3)

[CURLINFO\_QUEUE\_TIME\_T](#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)*](/man/os/curl/CURLINFO_QUEUE_TIME_T.3)

[CURLINFO\_REDIRECT\_COUNT](#CURLINFO_REDIRECT_COUNT)

Total number of redirects that were followed. See [*CURLINFO\_REDIRECT\_COUNT(3)*](/man/os/curl/CURLINFO_REDIRECT_COUNT.3)

[CURLINFO\_REDIRECT\_TIME](#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)*](/man/os/curl/CURLINFO_REDIRECT_TIME.3)

[CURLINFO\_REDIRECT\_TIME\_T](#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)*](/man/os/curl/CURLINFO_REDIRECT_TIME_T.3)

[CURLINFO\_REDIRECT\_URL](#CURLINFO_REDIRECT_URL)

URL a redirect would take you to, had you enabled redirects. See [*CURLINFO\_REDIRECT\_URL(3)*](/man/os/curl/CURLINFO_REDIRECT_URL.3)

[CURLINFO\_REFERER](#CURLINFO_REFERER)

Referrer header. See [*CURLINFO\_REFERER(3)*](/man/os/curl/CURLINFO_REFERER.3)

[CURLINFO\_REQUEST\_SIZE](#CURLINFO_REQUEST_SIZE)

Number of bytes sent in the issued HTTP requests. See [*CURLINFO\_REQUEST\_SIZE(3)*](/man/os/curl/CURLINFO_REQUEST_SIZE.3)

[CURLINFO\_RESPONSE\_CODE](#CURLINFO_RESPONSE_CODE)

Last received response code. See [*CURLINFO\_RESPONSE\_CODE(3)*](/man/os/curl/CURLINFO_RESPONSE_CODE.3)

[CURLINFO\_RETRY\_AFTER](#CURLINFO_RETRY_AFTER)

The value from the Retry-After header. See [*CURLINFO\_RETRY\_AFTER(3)*](/man/os/curl/CURLINFO_RETRY_AFTER.3)

[CURLINFO\_RTSP\_CLIENT\_CSEQ](#CURLINFO_RTSP_CLIENT_CSEQ)

The RTSP client CSeq that is expected next. See [*CURLINFO\_RTSP\_CLIENT\_CSEQ(3)*](/man/os/curl/CURLINFO_RTSP_CLIENT_CSEQ.3)

[CURLINFO\_RTSP\_CSEQ\_RECV](#CURLINFO_RTSP_CSEQ_RECV)

RTSP CSeq last received. See [*CURLINFO\_RTSP\_CSEQ\_RECV(3)*](/man/os/curl/CURLINFO_RTSP_CSEQ_RECV.3)

[CURLINFO\_RTSP\_SERVER\_CSEQ](#CURLINFO_RTSP_SERVER_CSEQ)

The RTSP server CSeq that is expected next. See [*CURLINFO\_RTSP\_SERVER\_CSEQ(3)*](/man/os/curl/CURLINFO_RTSP_SERVER_CSEQ.3)

[CURLINFO\_RTSP\_SESSION\_ID](#CURLINFO_RTSP_SESSION_ID)

RTSP session ID. See [*CURLINFO\_RTSP\_SESSION\_ID(3)*](/man/os/curl/CURLINFO_RTSP_SESSION_ID.3)

[CURLINFO\_SCHEME](#CURLINFO_SCHEME)

The scheme used for the connection. See [*CURLINFO\_SCHEME(3)*](/man/os/curl/CURLINFO_SCHEME.3)

[CURLINFO\_SIZE\_DELIVERED](#CURLINFO_SIZE_DELIVERED)

Number of bytes passed to the write callback. See [*CURLINFO\_SIZE\_DELIVERED(3)*](/man/os/curl/CURLINFO_SIZE_DELIVERED.3)

[CURLINFO\_SIZE\_DOWNLOAD](#CURLINFO_SIZE_DOWNLOAD)

(**Deprecated**) Number of bytes downloaded. See [*CURLINFO\_SIZE\_DOWNLOAD(3)*](/man/os/curl/CURLINFO_SIZE_DOWNLOAD.3)

[CURLINFO\_SIZE\_DOWNLOAD\_T](#CURLINFO_SIZE_DOWNLOAD_T)

Number of bytes downloaded. See [*CURLINFO\_SIZE\_DOWNLOAD\_T(3)*](/man/os/curl/CURLINFO_SIZE_DOWNLOAD_T.3)

[CURLINFO\_SIZE\_UPLOAD](#CURLINFO_SIZE_UPLOAD)

(**Deprecated**) Number of bytes uploaded. See [*CURLINFO\_SIZE\_UPLOAD(3)*](/man/os/curl/CURLINFO_SIZE_UPLOAD.3)

[CURLINFO\_SIZE\_UPLOAD\_T](#CURLINFO_SIZE_UPLOAD_T)

Number of bytes uploaded. See [*CURLINFO\_SIZE\_UPLOAD\_T(3)*](/man/os/curl/CURLINFO_SIZE_UPLOAD_T.3)

[CURLINFO\_SPEED\_DOWNLOAD](#CURLINFO_SPEED_DOWNLOAD)

(**Deprecated**) Average download speed. See [*CURLINFO\_SPEED\_DOWNLOAD(3)*](/man/os/curl/CURLINFO_SPEED_DOWNLOAD.3)

[CURLINFO\_SPEED\_DOWNLOAD\_T](#CURLINFO_SPEED_DOWNLOAD_T)

Average download speed. See [*CURLINFO\_SPEED\_DOWNLOAD\_T(3)*](/man/os/curl/CURLINFO_SPEED_DOWNLOAD_T.3)

[CURLINFO\_SPEED\_UPLOAD](#CURLINFO_SPEED_UPLOAD)

(**Deprecated**) Average upload speed. See [*CURLINFO\_SPEED\_UPLOAD(3)*](/man/os/curl/CURLINFO_SPEED_UPLOAD.3)

[CURLINFO\_SPEED\_UPLOAD\_T](#CURLINFO_SPEED_UPLOAD_T)

Average upload speed in number of bytes per second. See [*CURLINFO\_SPEED\_UPLOAD\_T(3)*](/man/os/curl/CURLINFO_SPEED_UPLOAD_T.3)

[CURLINFO\_SSL\_ENGINES](#CURLINFO_SSL_ENGINES)

A list of OpenSSL crypto engines. See [*CURLINFO\_SSL\_ENGINES(3)*](/man/os/curl/CURLINFO_SSL_ENGINES.3)

[CURLINFO\_SSL\_VERIFYRESULT](#CURLINFO_SSL_VERIFYRESULT)

Certificate verification result. See [*CURLINFO\_SSL\_VERIFYRESULT(3)*](/man/os/curl/CURLINFO_SSL_VERIFYRESULT.3)

[CURLINFO\_STARTTRANSFER\_TIME](#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)*](/man/os/curl/CURLINFO_STARTTRANSFER_TIME.3)

[CURLINFO\_STARTTRANSFER\_TIME\_T](#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)*](/man/os/curl/CURLINFO_STARTTRANSFER_TIME_T.3)

[CURLINFO\_TLS\_SESSION](#CURLINFO_TLS_SESSION)

(**Deprecated**) TLS session info that can be used for further processing. See [*CURLINFO\_TLS\_SESSION(3)*](/man/os/curl/CURLINFO_TLS_SESSION.3). Use [*CURLINFO\_TLS\_SSL\_PTR(3)*](/man/os/curl/CURLINFO_TLS_SSL_PTR.3) instead.

[CURLINFO\_TLS\_SSL\_PTR](#CURLINFO_TLS_SSL_PTR)

TLS session info that can be used for further processing. See [*CURLINFO\_TLS\_SSL\_PTR(3)*](/man/os/curl/CURLINFO_TLS_SSL_PTR.3)

[CURLINFO\_TOTAL\_TIME](#CURLINFO_TOTAL_TIME)

Total time of previous transfer. See [*CURLINFO\_TOTAL\_TIME(3)*](/man/os/curl/CURLINFO_TOTAL_TIME.3)

[CURLINFO\_TOTAL\_TIME\_T](#CURLINFO_TOTAL_TIME_T)

Total time of previous transfer. See [*CURLINFO\_TOTAL\_TIME\_T(3)*](/man/os/curl/CURLINFO_TOTAL_TIME_T.3)

[CURLINFO\_USED\_PROXY](#CURLINFO_USED_PROXY)

Whether the proxy was used (Added in 8.7.0). See [*CURLINFO\_USED\_PROXY(3)*](/man/os/curl/CURLINFO_USED_PROXY.3)

[CURLINFO\_XFER\_ID](#CURLINFO_XFER_ID)

The ID of the transfer. (Added in 8.2.0) See [*CURLINFO\_XFER\_ID(3)*](/man/os/curl/CURLINFO_XFER_ID.3)

# [TIMES](#TIMES)

An overview of the time values available from [*curl\_easy\_getinfo(3)*](/man/os/curl/curl_easy_getinfo.3)

```
curl_easy_perform()


    |


    |--QUEUE


    |--|--NAMELOOKUP


    |--|--|--CONNECT


    |--|--|--|--APPCONNECT


    |--|--|--|--|--PRETRANSFER


    |--|--|--|--|--|--POSTTRANSFER


    |--|--|--|--|--|--|--STARTTRANSFER


    |--|--|--|--|--|--|--|--TOTAL


    |--|--|--|--|--|--|--|--REDIRECT
```

[*CURLINFO\_QUEUE\_TIME\_T(3)*](/man/os/curl/CURLINFO_QUEUE_TIME_T.3), [*CURLINFO\_NAMELOOKUP\_TIME\_T(3)*](/man/os/curl/CURLINFO_NAMELOOKUP_TIME_T.3), [*CURLINFO\_CONNECT\_TIME\_T(3)*](/man/os/curl/CURLINFO_CONNECT_TIME_T.3), [*CURLINFO\_APPCONNECT\_TIME\_T(3)*](/man/os/curl/CURLINFO_APPCONNECT_TIME_T.3), [*CURLINFO\_PRETRANSFER\_TIME\_T(3)*](/man/os/curl/CURLINFO_PRETRANSFER_TIME_T.3), [*CURLINFO\_POSTTRANSFER\_TIME\_T(3)*](/man/os/curl/CURLINFO_POSTTRANSFER_TIME_T.3), [*CURLINFO\_STARTTRANSFER\_TIME\_T(3)*](/man/os/curl/CURLINFO_STARTTRANSFER_TIME_T.3), [*CURLINFO\_TOTAL\_TIME\_T(3)*](/man/os/curl/CURLINFO_TOTAL_TIME_T.3), [*CURLINFO\_REDIRECT\_TIME\_T(3)*](/man/os/curl/CURLINFO_REDIRECT_TIME_T.3)

# [PROTOCOLS](#PROTOCOLS)

This functionality affects all supported protocols

# [EXAMPLE](#EXAMPLE)

```
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](#AVAILABILITY)

Added in curl 7.4.1

# [RETURN VALUE](#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)*](/man/os/curl/libcurl-errors.3). If [*CURLOPT\_ERRORBUFFER(3)*](/man/os/curl/CURLOPT_ERRORBUFFER.3) was set with [*curl\_easy\_setopt(3)*](/man/os/curl/curl_easy_setopt.3) there can be an error message stored in the error buffer when non-zero is returned.

# [SEE ALSO](#SEE_ALSO)

[**curl\_easy\_setopt**(3)](/man/os/curl/curl_easy_setopt.3)

2026-10-14 libcurl

---

Document: curl_easy_getinfo(3) from curl 8.23.0-r0 (Chainguard OS)
Source: https://github.com/curl/curl.git
