curl_easy_getinfo.3 5.6 KB

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