Tor Arntsen's major ispell patch
[platform/upstream/curl.git] / docs / libcurl / curl_easy_getinfo.3
1 .\" You can view this file with:
2 .\" nroff -man [file]
3 .\" $Id$
4 .\"
5 .TH curl_easy_getinfo 3 "20 Aug 2003" "libcurl 7.10.8" "libcurl Manual"
6 .SH NAME
7 curl_easy_getinfo - extract information from a curl handle
8 .SH SYNOPSIS
9 .B #include <curl/curl.h>
10
11 .B "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );"
12
13 .SH DESCRIPTION
14 Request internal information from the curl session with this function.  The
15 third argument
16 .B MUST
17 be a pointer to a long, a pointer to a char * or a pointer to a double (as
18 this documentation describes further down).  The data pointed-to will be
19 filled in accordingly and can be relied upon only if the function returns
20 CURLE_OK.  This function is intended to get used *AFTER* a performed transfer,
21 all results from this function are undefined until the transfer is completed.
22 .SH AVAILABLE INFORMATION
23 The following information can be extracted:
24 .IP CURLINFO_EFFECTIVE_URL
25 Pass a pointer to a 'char *' to receive the last used effective URL.
26 .IP CURLINFO_RESPONSE_CODE
27 Pass a pointer to a long to receive the last received HTTP or FTP code. This
28 option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier.
29 .IP CURLINFO_FILETIME
30 Pass a pointer to a long to receive the remote time of the retrieved
31 document. If you get -1, it can be because of many reasons (unknown, the
32 server hides it or the server doesn't support the command that tells document
33 time etc) and the time of the document is unknown. Note that you must tell the
34 server to collect this information before the transfer is made, by using the
35 CURLOPT_FILETIME option to \fIcurl_easy_setopt(3)\fP. (Added in 7.5)
36 .IP CURLINFO_TOTAL_TIME
37 Pass a pointer to a double to receive the total transaction time in seconds
38 for the previous transfer. This time does not include the connect time, so if
39 you want the complete operation time, you should add the
40 CURLINFO_CONNECT_TIME.
41 .IP CURLINFO_NAMELOOKUP_TIME
42 Pass a pointer to a double to receive the time, in seconds, it took from the
43 start until the name resolving was completed.
44 .IP CURLINFO_CONNECT_TIME
45 Pass a pointer to a double to receive the time, in seconds, it took from the
46 start until the connect to the remote host (or proxy) was completed.
47 .IP CURLINFO_PRETRANSFER_TIME
48 Pass a pointer to a double to receive the time, in seconds, it took from the
49 start until the file transfer is just about to begin. This includes all
50 pre-transfer commands and negotiations that are specific to the particular
51 protocol(s) involved.
52 .IP CURLINFO_STARTTRANSFER_TIME
53 Pass a pointer to a double to receive the time, in seconds, it took from the
54 start until the first byte is just about to be transferred. This includes
55 CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate
56 the result.
57 .IP CURLINFO_REDIRECT_TIME
58 Pass a pointer to a double to receive the total time, in seconds, it took for
59 all redirection steps include name lookup, connect, pretransfer and transfer
60 before final transaction was started. CURLINFO_REDIRECT_TIME contains the
61 complete execution time for multiple redirections.  (Added in 7.9.7)
62 .IP CURLINFO_REDIRECT_COUNT
63 Pass a pointer to a long to receive the total number of redirections that were
64 actually followed.  (Added in 7.9.7)
65 .IP CURLINFO_SIZE_UPLOAD
66 Pass a pointer to a double to receive the total amount of bytes that were
67 uploaded.
68 .IP CURLINFO_SIZE_DOWNLOAD
69 Pass a pointer to a double to receive the total amount of bytes that were
70 downloaded. The amount is only for the latest transfer and will be reset again
71 for each new transfer.
72 .IP CURLINFO_SPEED_DOWNLOAD
73 Pass a pointer to a double to receive the average download speed that curl
74 measured for the complete download.
75 .IP CURLINFO_SPEED_UPLOAD
76 Pass a pointer to a double to receive the average upload speed that curl
77 measured for the complete upload.
78 .IP CURLINFO_HEADER_SIZE
79 Pass a pointer to a long to receive the total size of all the headers
80 received.
81 .IP CURLINFO_REQUEST_SIZE
82 Pass a pointer to a long to receive the total size of the issued
83 requests. This is so far only for HTTP requests. Note that this may be more
84 than one request if FOLLOWLOCATION is true.
85 .IP CURLINFO_SSL_VERIFYRESULT
86 Pass a pointer to a long to receive the result of the certification
87 verification that was requested (using the CURLOPT_SSL_VERIFYPEER option to
88 \fIcurl_easy_setopt(3)\fP).
89 .IP CURLINFO_CONTENT_LENGTH_DOWNLOAD
90 Pass a pointer to a double to receive the content-length of the download. This
91 is the value read from the Content-Length: field.
92 .IP CURLINFO_CONTENT_LENGTH_UPLOAD
93 Pass a pointer to a double to receive the specified size of the upload.
94 .IP CURLINFO_CONTENT_TYPE
95 Pass a pointer to a 'char *' to receive the content-type of the downloaded
96 object. This is the value read from the Content-Type: field. If you get NULL,
97 it means that the server didn't send a valid Content-Type header or that the
98 protocol used doesn't support this.
99 .IP CURLINFO_PRIVATE
100 Pass a pointer to a 'char *' to receive the pointer to the private data
101 associated with the curl handle (set with the CURLOPT_PRIVATE option to
102 \fIcurl_easy_setopt(3)\fP). (Added in 7.10.3)
103 .IP CURLINFO_HTTPAUTH_AVAIL
104 Pass a pointer to a long to receive a bitmask indicating the authentication
105 method(s) available. The meaning of the bits is explained in the
106 CURLOPT_HTTPAUTH option for \fIcurl_easy_setopt(3)\fP.  (Added in 7.10.8)
107 .IP CURLINFO_PROXYAUTH_AVAIL
108 Pass a pointer to a long to receive a bitmask indicating the authentication
109 method(s) available for your proxy authentication.  (Added in 7.10.8)
110 .SH RETURN VALUE
111 If the operation was successful, CURLE_OK is returned. Otherwise an
112 appropriate error code will be returned.
113 .SH "SEE ALSO"
114 .BR curl_easy_setopt "(3)"