corrected main meta data title
[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 "25 Apr 2002" "libcurl 7.9.7" "libcurl Manual"
6 .SH NAME
7 curl_easy_getinfo - Extract information from a curl session (added in 7.4)
8 .SH SYNOPSIS
9 .B #include <curl/curl.h>
10 .sp
11 .BI "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );"
12 .ad
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 These are informations that can be extracted:
24 .TP 0.8i
25 .B CURLINFO_EFFECTIVE_URL
26 Pass a pointer to a 'char *' to receive the last used effective URL.
27 .TP
28 .B CURLINFO_HTTP_CODE
29 Pass a pointer to a long to receive the last received HTTP code.
30 .TP
31 .B CURLINFO_FILETIME
32 Pass a pointer to a long to receive the remote time of the retrieved
33 document. If you get -1, it can be because of many reasons (unknown, the
34 server hides it or the server doesn't support the command that tells document
35 time etc) and the time of the document is unknown. Note that you must tell the
36 server to collect this information before the transfer is made, by using the
37 CURLOPT_FILETIME option to \fIcurl_easy_setopt(3)\fP. (Added in 7.5)
38 .TP
39 .B CURLINFO_TOTAL_TIME
40 Pass a pointer to a double to receive the total transaction time in seconds
41 for the previous transfer. This time does not include the connect time, so if
42 you want the complete operation time, you should add the
43 CURLINFO_CONNECT_TIME.
44 .TP
45 .B CURLINFO_NAMELOOKUP_TIME
46 Pass a pointer to a double to receive the time, in seconds, it took from the
47 start until the name resolving was completed.
48 .TP
49 .B CURLINFO_CONNECT_TIME
50 Pass a pointer to a double to receive the time, in seconds, it took from the
51 start until the connect to the remote host (or proxy) was completed.
52 .TP
53 .B CURLINFO_PRETRANSFER_TIME
54 Pass a pointer to a double to receive the time, in seconds, it took from the
55 start until the file transfer is just about to begin. This includes all
56 pre-transfer commands and negotiations that are specific to the particular
57 protocol(s) involved.
58 .TP
59 .B CURLINFO_STARTTRANSFER_TIME
60 Pass a pointer to a double to receive the time, in seconds, it took from the
61 start until the first byte is just about to be transfered. This includes
62 CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate
63 the result.
64 .TP
65 .B CURLINFO_REDIRECT_TIME
66 Pass a pointer to a double to receive the total time, in seconds, it took for
67 all redirection steps include name lookup, connect, pretransfer and transfer
68 before final transaction was started. CURLINFO_REDIRECT_TIME contains the
69 complete execution time for multiple redirections.  (Added in 7.9.7)
70 .TP
71 .B CURLINFO_REDIRECT_COUNT
72 Pass a pointer to a long to receive the total number of redirections that were
73 actually followed.  (Added in 7.9.7)
74 .TP
75 .B CURLINFO_SIZE_UPLOAD
76 Pass a pointer to a double to receive the total amount of bytes that were
77 uploaded.
78 .TP
79 .B CURLINFO_SIZE_DOWNLOAD
80 Pass a pointer to a double to receive the total amount of bytes that were
81 downloaded. The amount is only for the latest transfer and will be reset again
82 for each new transfer.
83 .TP
84 .B CURLINFO_SPEED_DOWNLOAD
85 Pass a pointer to a double to receive the average download speed that curl
86 measured for the complete download.
87 .TP
88 .B CURLINFO_SPEED_UPLOAD
89 Pass a pointer to a double to receive the average upload speed that curl
90 measured for the complete upload.
91 .TP
92 .B CURLINFO_HEADER_SIZE
93 Pass a pointer to a long to receive the total size of all the headers
94 received.
95 .TP
96 .B CURLINFO_REQUEST_SIZE
97 Pass a pointer to a long to receive the total size of the issued
98 requests. This is so far only for HTTP requests. Note that this may be more
99 than one request if FOLLOWLOCATION is true.
100 .TP
101 .B CURLINFO_SSL_VERIFYRESULT
102 Pass a pointer to a long to receive the result of the certification
103 verification that was requested (using the CURLOPT_SSL_VERIFYPEER option to
104 curl_easy_setopt). (Added in 7.4.2)
105 .TP
106 .B CURLINFO_CONTENT_LENGTH_DOWNLOAD
107 Pass a pointer to a double to receive the content-length of the download. This
108 is the value read from the Content-Length: field.  (Added in 7.6.1)
109 .TP
110 .B CURLINFO_CONTENT_LENGTH_UPLOAD
111 Pass a pointer to a double to receive the specified size of the upload.
112 (Added in 7.6.1)
113 .TP
114 .B CURLINFO_CONTENT_TYPE
115 Pass a pointer to a 'char *' to receive the content-type of the downloaded
116 object. This is the value read from the Content-Type: field. If you get NULL,
117 it means that the server didn't send a valid Content-Type header or that the
118 protocol used doesn't support this.  (Added in 7.9.4)
119 .TP
120 .B CURLINFO_PRIVATE
121 Pass a pointer to a 'char *' to receive the pointer to the private data
122 associated with the curl handle (set with the CURLOPT_PRIVATE option to curl_easy_setopt).
123 (Added in 7.10.3)
124 .PP
125 .SH RETURN VALUE
126 If the operation was successful, CURLE_OK is returned. Otherwise an
127 appropriate error code will be returned.
128 .SH "SEE ALSO"
129 .BR curl_easy_setopt "(3)"
130 .SH BUGS
131 Surely there are some, you tell me!