NAME
curleasygetinfo - extract information from a curl handle
SYNOPSIS
##iinncclluuddee <
CCUURRLLccooddee ccuurrlleeaassyyggeettiinnffoo((CCUURRLL **ccuurrll,, CCUURRLLIINNFFOO iinnffoo,, ...... ));;> DESCRIPTION
Request internal information from the curl session with this function. The third argument MMUUSSTT be a pointer to a long, a pointer to a char *, a pointer to a struct curlslist * or a pointer to a double (as thisdocumentation describes further down). The data pointed-to will be
filled in accordingly and can be relied upon only if the functionreturns CURLEOK. This function is intended to get used AFTER a per-
formed transfer, all results from this function are undefined until the transfer is completed. You should not free the memory returned by this function unless it is explictly mentioned below. AAVVAAIILLAABBLLEE IINNFFOORRMMAATTIIOONN The following information can be extracted: CURLINFOEFFECTIVEURL Pass a pointer to a 'char *' to receive the last used effective URL. CURLINFORESPONSECODE Pass a pointer to a long to receive the last received HTTP or FTP code. This option was known as CURLINFOHTTPCODE in libcurl 7.10.7 and earlier. This will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with CURLINFOHTTPCONNECTCODE and not this. CURLINFOHTTPCONNECTCODE Pass a pointer to a long to receive the last received proxy response code to a CONNECT request. CURLINFOFILETIME Pass a pointer to a long to receive the remote time of theretrieved document. If you get -1, it can be because of many
reasons (unknown, the server hides it or the server doesn't sup-
port the command that tells document time etc) and the time of the document is unknown. Note that you must tell the server to collect this information before the transfer is made, by using the CURLOPTFILETIME option to curleasysetopt(3). (Added in 7.5) CURLINFOTOTALTIME Pass a pointer to a double to receive the total transaction time in seconds for the previous transfer. This time does not include the connect time, so if you want the complete operation time, you should add the CURLINFOCONNECTTIME.CURLINFONAMELOOKUPTIME
Pass a pointer to a double to receive the time, in seconds, it took from the start until the name resolving was completed. CURLINFOCONNECTTIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the connect to the remote host (or proxy) was completed. CURLINFOPRETRANSFERTIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the file transfer is just about tobegin. This includes all pre-transfer commands and negotiations
that are specific to the particular protocol(s) involved. CURLINFOSTARTTRANSFERTIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the first byte is just about to be transferred. This includes CURLINFOPRETRANSFERTIME and also the time the server needs to calculate the result. CURLINFOREDIRECTTIMEPass a pointer to a double to receive the total time, in sec-
onds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. CURLINFOREDIRECTTIME contains the complete execution time for multiple redirections. (Added in 7.9.7) CURLINFOREDIRECTCOUNTPass a pointer to a long to receive the total number of redirec-
tions that were actually followed. (Added in 7.9.7) CURLINFOSIZEUPLOAD Pass a pointer to a double to receive the total amount of bytes that were uploaded. CURLINFOSIZEDOWNLOAD Pass a pointer to a double to receive the total amount of bytes that were downloaded. The amount is only for the latest transfer and will be reset again for each new transfer. CURLINFOSPEEDDOWNLOAD Pass a pointer to a double to receive the average download speed that curl measured for the complete download. CURLINFOSPEEDUPLOAD Pass a pointer to a double to receive the average upload speed that curl measured for the complete upload. CURLINFOHEADERSIZE Pass a pointer to a long to receive the total size of all the headers received. CURLINFOREQUESTSIZE Pass a pointer to a long to receive the total size of the issued requests. This is so far only for HTTP requests. Note that this may be more than one request if FOLLOWLOCATION is true. CURLINFOSSLVERIFYRESULTPass a pointer to a long to receive the result of the certifica-
tion verification that was requested (using the CURLOPTSSLVER-
IFYPEER option to curleasysetopt(3)). CURLINFOSSLENGINESPass the address of a 'struct curlslist *' to receive a linked-
list of OpenSSL crypto-engines supported. Note that engines are
normally implemented in separate dynamic libraries. Hence notall the returned engines may be available at run-time. NNOOTTEE:: you
must call curlslistfreeall(3) on the list pointer once you're done with it, as libcurl will not free the data for you. (Added in 7.12.3) CURLINFOCONTENTLENGTHDOWNLOADPass a pointer to a double to receive the content-length of the
download. This is the value read from the Content-Length: field.
CURLINFOCONTENTLENGTHUPLOAD Pass a pointer to a double to receive the specified size of the upload. CURLINFOCONTENTTYPEPass a pointer to a 'char *' to receive the content-type of the
downloaded object. This is the value read from the Content-Type:
field. If you get NULL, it means that the server didn't send avalid Content-Type header or that the protocol used doesn't sup-
port this. CURLINFOPRIVATEPass a pointer to a 'char *' to receive the pointer to the pri-
vate data associated with the curl handle (set with the CUR-
LOPTPRIVATE option to curleasysetopt(3)). (Added in 7.10.3) CURLINFOHTTPAUTHAVAIL Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available. The meaning of the bits is explained in the CURLOPTHTTPAUTH option for curleasysetopt(3). (Added in 7.10.8) CURLINFOPROXYAUTHAVAIL Pass a pointer to a long to receive a bitmask indicating theauthentication method(s) available for your proxy authentica-
tion. (Added in 7.10.8) CURLINFOOSERRNO Pass a pointer to a long to receive the errno variable from a connect failure. (Added in 7.12.2) CURLINFONUMCONNECTS Pass a pointer to a long to receive how many new connections libcurl had to create to achieve the previous transfer (only thesuccessful connects are counted). Combined with CURLINFOREDI-
RECTCOUNT you are able to know how many times libcurl success-
fully reused existing connection(s) or not. See the Connection Options of curleasysetopt(3) to see how libcurl tries to make persistent connections to save time. (Added in 7.12.3) RREETTUURRNN VVAALLUUEE If the operation was successful, CURLEOK is returned. Otherwise an appropriate error code will be returned.SEE ALSO
ccuurrlleeaassyysseettoopptt(3) libcurl 7.12.3 22 Dec 2004 curleasygetinfo(3)