curleasygetinfo(3) libcurl Manual curleasygetinfo(3)
NAME
curleasygetinfo - extract information from a curl handle
SYNOPSIS
##include <>
CURLcode curleasygetinfo(CURL **curl,, CURLINFO info,, ... );;
DESCRIPTION
Request internal information from the curl session with this function.
The third argument MUST be a pointer to a long, a pointer to a char *,
a pointer to a struct curlslist * or a pointer to a double (as this
documentation describes further down). The data pointed-to will be
filled in accordingly and can be relied upon only if the function
returns 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.
AVAILABLE INFORMATION
The following information can be extracted:
CURLINFOEFECTIVEURL
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 HTP or
FTP code. This option was known as CURLINFOHTPCODE in libcurl
7.10.7 and earlier. This will be zero if no server response code
has been received. Note that a proxy's CONECT response should
be read with CURLINFOHTPCONECTCODE and not this.
CURLINFOHTPCONECTCODE
Pass a pointer to a long to receive the last received proxy
response code to a CONECT request.
CURLINFOFILETIME
Pass a pointer to a long to receive the remote time of the
retrieved 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 CURLINFOCONECTIME.
CURLINFONAMELOKUPTIME
Pass a pointer to a double to receive the time, in seconds, it
took from the start until the name resolving was completed.
CURLINFOCONECTIME
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 to
begin. This includes all pre-transfer commands and negotiations
that are specific to the particular protocol(s) involved.
CURLINFOSTARTRANSFERTIME
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.
CURLINFOREDIRECTIME
Pass 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. CURLINFOREDIRECTIME contains the complete execution
time for multiple redirections. (Added in 7.9.7)
CURLINFOREDIRECTCOUNT
Pass 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.
CURLINFOSPEDOWNLOAD
Pass a pointer to a double to receive the average download speed
that curl measured for the complete download.
CURLINFOSPEDUPLOAD
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 HTP requests. Note that this
may be more than one request if FOLOWLOCATION is true.
CURLINFOSLVERIFYRESULT
Pass a pointer to a long to receive the result of the certifica-
tion verification that was requested (using the CURLOPTSLVER-
IFYPER option to curleasysetopt(3)).
CURLINFOSLENGINES
Pass the address of a 'struct curlslist *' to receive a linked-
list of OpenSL crypto-engines supported. Note that engines are
normally implemented in separate dynamic libraries. Hence not
all the returned engines may be available at run-time. NOTE:: 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)
CURLINFOCONTENTLENGTHDOWNLOAD
Pass 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.
CURLINFOCONTENTYPE
Pass 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 NUL, it means that the server didn't send a
valid Content-Type header or that the protocol used doesn't sup-
port this.
CURLINFOPRIVATE
Pass 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)
CURLINFOHTPAUTHAVAIL
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 CURLOPTHTPAUTH option for
curleasysetopt(3). (Added in 7.10.8)
CURLINFOPROXYAUTHAVAIL
Pass a pointer to a long to receive a bitmask indicating the
authentication method(s) available for your proxy authentica-
tion. (Added in 7.10.8)
CURLINFOSERNO
Pass a pointer to a long to receive the errno variable from a
connect failure. (Added in 7.12.2)
CURLINFONUMCONECTS
Pass a pointer to a long to receive how many new connections
libcurl had to create to achieve the previous transfer (only the
successful 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)
RETURN VALUE
If the operation was successful, CURLEOK is returned. Otherwise an
appropriate error code will be returned.
SEE ALSO
curleasysetopt(3)
libcurl 7.12.3 22 Dec 2004 curleasygetinfo(3)
|