Reputation: 2388
Hi I'm using RJSONIO in Windows and when I perform the following it works fine:
library(RJSONIO)
fromJSON("https://issues.apache.org/jira/rest/api/2/project")
It returns a JSON but when I do the same thing in Linux I get the following error:
Error in file(con, "r") : cannot open the connection
after doing some search on Google I noticed I needed to mention "file=" fromJSON(file="https://issues.apache.org/jira/rest/api/2/project")
so now I get the error:
unable to find an inherited method for function âfromJSONâ for signature â"missing", "missing"â
Any suggests ?
Upvotes: 0
Views: 293
Reputation: 32351
That is explained in ?url
: http://
URLs work exactly like files everywhere,
but https://
URLs do not.
Note that the
https://
URL scheme is not supported except on Windows. There it is only supported if--internet2
orsetInternet2(TRUE)
was used (to make use of Internet Explorer internals), and then only if the certificate is considered to be valid. With that option only, thehttp://user:pass@site
notation for sites requiring authentication is also accepted.
You can explicitly use RCurl
:
fromJSON(RCurl::getURL("https://issues.apache.org/jira/rest/api/2/project"))
Upvotes: 2