CURLHandle
object.curlSetOpt(..., .opts = list(), curl = getCurlHandle(),
.encoding = integer(), .forceHeaderNames = FALSE,
.isProtected = FALSE)
CURLOptions
object identifying the
curl options for the handle.CURLHandle
object created earlier via
a call to getCurlHandle
or
dupCurlHandle
TRUE
allows the caller to explicitly indicate that the HTTPHEADER
option needs to have the names prefixed to the strings.
This removes any ambiguity caused by the presence of ':' in the
values appeari.opts
need to be explicitly
protected from garbage collection or not.
The basic idea is that we specify FALSE
if
the value being sgetCurlHandle
dupCurlHandle
if(url.exists("http://www.omegahat.org")) {
curl = getCurlHandle()
# Note the header that extends across two lines with the second line
# prefixed with white space.
curlSetOpt( .opts = list(httpheader = c(Date = "Wed, 1/2/2000 10:01:01",
foo="abc
extra line"), verbose = TRUE),
curl = curl)
ans = getURL("http://www.omegahat.org", curl = curl)
}
Run the code above in your browser using DataLab