| 1 |
\name{getCurlInfo} |
| 2 |
\alias{getCurlInfo} |
| 3 |
\alias{getCurlInfoConstants} |
| 4 |
\title{Access information about a CURL request} |
| 5 |
\description{ |
| 6 |
This function provides access to data about a previously |
| 7 |
executed CURL request that is accessible via a |
| 8 |
\code{CURLHandle} object. |
| 9 |
This means, of course, that one must have access to the \code{CURLHandle} |
| 10 |
object. |
| 11 |
The information one can get includes items such as the name of the |
| 12 |
file (potentially containing redirects), download time, |
| 13 |
|
| 14 |
See \code{\link{getCurlInfoConstants}} for the names of the possible fields. |
| 15 |
} |
| 16 |
\usage{ |
| 17 |
getCurlInfo(curl, which = getCurlInfoConstants()) |
| 18 |
getCurlInfoConstants() |
| 19 |
} |
| 20 |
%- maybe also 'usage' for other objects documented here. |
| 21 |
\arguments{ |
| 22 |
\item{curl}{the \code{CURLHandle} object used to perform the request. |
| 23 |
This is a reference to an opaque internal C-level data structure that is |
| 24 |
provided and used by libcurl to make a request.} |
| 25 |
\item{which}{identifiers for the elements of interest. |
| 26 |
These can be specified by integer value or by name. |
| 27 |
The names are matched against those in the |
| 28 |
\code{\link{getCurlInfoConstants}}}. |
| 29 |
} |
| 30 |
\details{ |
| 31 |
This is an interface to the \code{get_curl_info} routine in |
| 32 |
the libcurl package. |
| 33 |
} |
| 34 |
\value{ |
| 35 |
A named list whose elements correspond |
| 36 |
to the requested fields. |
| 37 |
The names are expanded to match the names of these |
| 38 |
fields and the values are either strings or integer values. |
| 39 |
} |
| 40 |
|
| 41 |
\references{Curl homepage \url{https://curl.se/}} |
| 42 |
\author{Duncan Temple Lang} |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
\seealso{ |
| 47 |
\code{\link{curlPerform}} |
| 48 |
\code{\link{getURL}} |
| 49 |
\code{\link{getCurlHandle}} |
| 50 |
} |
| 51 |
\examples{ |
| 52 |
tryCatch(withAutoprint({ |
| 53 |
curl = getCurlHandle() |
| 54 |
txt = getURL("https://r-project.org", curl = curl) |
| 55 |
getCurlInfo(curl) |
| 56 |
rm(curl) # release the curl! |
| 57 |
}), GenericCurlError = identity) |
| 58 |
} |
| 59 |
\keyword{IO} |
| 60 |
|