curlSetOpt {RCurl} | R Documentation |
Set values for the CURL options
Description
This function allows us to set values for the
possible options in the CURL data structure
that defines the HTTP request.
These options persist across calls in the
CURLHandle
object.
Usage
curlSetOpt(..., .opts = list(), curl = getCurlHandle(),
.encoding = integer(), .forceHeaderNames = FALSE,
.isProtected = FALSE)
Arguments
... |
a named list of curl options to set after the handle has been created. |
.opts |
a named list or |
curl |
the |
.encoding |
an integer or a string that explicitly identifies the
encoding of the content that is returned by the HTTP server in its
response to our query. The possible strings are
‘UTF-8’ or ‘ISO-8859-1’
and the integers should be specified symbolically
as |
.forceHeaderNames |
a logical value which if |
.isProtected |
a logical vector (or value that is repeated) specifying which
of the values in ... and |
Value
An integer value giving the status of the return. This should be 0 as if there was an error in the libcurl mechiansim, we will throw it there.
Author(s)
Duncan Temple Lang
References
Curl homepage https://curl.se/
See Also
Examples
if(url.exists("https://www.omegahat.net")) {
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\n extra line"), verbose = TRUE),
curl = curl)
ans = getURL("https://www.omegahat.net", curl = curl)
}