⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curl_easy_getinfo.3

📁 harvest是一个下载html网页得机器人
💻 3
字号:
.\" You can view this file with:.\" nroff -man [file].\" $Id: curl_easy_getinfo.3,v 1.7 2003/08/20 15:44:03 bagder Exp $.\".TH curl_easy_getinfo 3 "20 Aug 2003" "libcurl 7.10.8" "libcurl Manual".SH NAMEcurl_easy_getinfo - Extract information from a curl session (added in 7.4).SH SYNOPSIS.B #include <curl/curl.h>.sp.BI "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );".ad.SH DESCRIPTIONRequest internal information from the curl session with this function.  Thethird argument.B MUSTbe a pointer to a long, a pointer to a char * or a pointer to a double (asthis documentation describes further down).  The data pointed-to will befilled in accordingly and can be relied upon only if the function returnsCURLE_OK.  This function is intended to get used *AFTER* a performed transfer,all results from this function are undefined until the transfer is completed..SH AVAILABLE INFORMATIONThese are informations that can be extracted:.TP 0.8i.B CURLINFO_EFFECTIVE_URLPass a pointer to a 'char *' to receive the last used effective URL..TP.B CURLINFO_RESPONSE_CODEPass a pointer to a long to receive the last received HTTP or FTP code. Thisoption was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier..TP.B CURLINFO_FILETIMEPass a pointer to a long to receive the remote time of the retrieveddocument. If you get -1, it can be because of many reasons (unknown, theserver hides it or the server doesn't support the command that tells documenttime etc) and the time of the document is unknown. Note that you must tell theserver to collect this information before the transfer is made, by using theCURLOPT_FILETIME option to \fIcurl_easy_setopt(3)\fP. (Added in 7.5).TP.B CURLINFO_TOTAL_TIMEPass a pointer to a double to receive the total transaction time in secondsfor the previous transfer. This time does not include the connect time, so ifyou want the complete operation time, you should add theCURLINFO_CONNECT_TIME..TP.B CURLINFO_NAMELOOKUP_TIMEPass a pointer to a double to receive the time, in seconds, it took from thestart until the name resolving was completed..TP.B CURLINFO_CONNECT_TIMEPass a pointer to a double to receive the time, in seconds, it took from thestart until the connect to the remote host (or proxy) was completed..TP.B CURLINFO_PRETRANSFER_TIMEPass a pointer to a double to receive the time, in seconds, it took from thestart until the file transfer is just about to begin. This includes allpre-transfer commands and negotiations that are specific to the particularprotocol(s) involved..TP.B CURLINFO_STARTTRANSFER_TIMEPass a pointer to a double to receive the time, in seconds, it took from thestart until the first byte is just about to be transfered. This includesCURLINFO_PRETRANSFER_TIME and also the time the server needs to calculatethe result..TP.B CURLINFO_REDIRECT_TIMEPass a pointer to a double to receive the total time, in seconds, it took forall redirection steps include name lookup, connect, pretransfer and transferbefore final transaction was started. CURLINFO_REDIRECT_TIME contains thecomplete execution time for multiple redirections.  (Added in 7.9.7).TP.B CURLINFO_REDIRECT_COUNTPass a pointer to a long to receive the total number of redirections that wereactually followed.  (Added in 7.9.7).TP.B CURLINFO_SIZE_UPLOADPass a pointer to a double to receive the total amount of bytes that wereuploaded..TP.B CURLINFO_SIZE_DOWNLOADPass a pointer to a double to receive the total amount of bytes that weredownloaded. The amount is only for the latest transfer and will be reset againfor each new transfer..TP.B CURLINFO_SPEED_DOWNLOADPass a pointer to a double to receive the average download speed that curlmeasured for the complete download..TP.B CURLINFO_SPEED_UPLOADPass a pointer to a double to receive the average upload speed that curlmeasured for the complete upload..TP.B CURLINFO_HEADER_SIZEPass a pointer to a long to receive the total size of all the headersreceived..TP.B CURLINFO_REQUEST_SIZEPass a pointer to a long to receive the total size of the issuedrequests. This is so far only for HTTP requests. Note that this may be morethan one request if FOLLOWLOCATION is true..TP.B CURLINFO_SSL_VERIFYRESULTPass a pointer to a long to receive the result of the certificationverification that was requested (using the CURLOPT_SSL_VERIFYPEER option tocurl_easy_setopt). (Added in 7.4.2).TP.B CURLINFO_CONTENT_LENGTH_DOWNLOADPass a pointer to a double to receive the content-length of the download. Thisis the value read from the Content-Length: field.  (Added in 7.6.1).TP.B CURLINFO_CONTENT_LENGTH_UPLOADPass a pointer to a double to receive the specified size of the upload.(Added in 7.6.1).TP.B CURLINFO_CONTENT_TYPEPass a pointer to a 'char *' to receive the content-type of the downloadedobject. This is the value read from the Content-Type: field. If you get NULL,it means that the server didn't send a valid Content-Type header or that theprotocol used doesn't support this.  (Added in 7.9.4).TP.B CURLINFO_PRIVATEPass a pointer to a 'char *' to receive the pointer to the private dataassociated with the curl handle (set with the CURLOPT_PRIVATE option to curl_easy_setopt).(Added in 7.10.3).PP.SH RETURN VALUEIf the operation was successful, CURLE_OK is returned. Otherwise anappropriate error code will be returned..SH "SEE ALSO".BR curl_easy_setopt "(3)".SH BUGSSurely there are some, you tell me!

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -