I am working with an algorithm R that calls a webservice that makes a query to a database and returns a JSON object.
url <- "https://example.com?id=1"
json_file <- "C:/xampp/htdocs/example/Download/data.json"
download.file(url, json_file)
document <- fromJSON(json_file)
On my machine the algorithm usually works bad when I go up to the server and run, I get the following error:
Error in download.file(url, json_file) : unsupported URL scheme
here is some problem for the url be https?
From the Details section of ?download.file
.
Note that 'https://' URLs are only supported if '--internet2' or environment variable 'R_WIN_INTERNET2' was set or 'setInternet2(TRUE)' was used (to make use of Internet Explorer internals), and then only if the certificate is considered to be valid.
In Ubuntu, you can use method = "curl"
to use curl to download.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With