I'm behind a VPN. And I think whoever administers it must have done some weird change lately because suddenly my script doesn't work.
It's not terribly important to know what the below is doing, basically logging into SFDC so that I can later download a CSV..
The point is that if I were to simply plop in the url string (https://login.salesforce.com/?un=username@domain.com&pw=password) into my web browser, it will work no problem. So why, with the EXACT same URL, is R unable to connect to host?
library(RCurl)
agent="Firefox/23.0"
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))
curl = getCurlHandle()
curlSetOpt(
cookiejar = 'cookies.txt' ,
useragent = agent,
followlocation = TRUE ,
autoreferer = TRUE ,
curl = curl
)
un="username@domain.com"
pw="password"
html = postForm(paste("https://login.salesforce.com/?un=", un, "&pw=", pw, sep=""), curl=curl)