This网址可在浏览器中使用,提供一些JSON数据。
它从R开始一直运行到最近,现在返回:
library(jsonlite)
fromJSON("https://api.worldbank.org/v2/country?format=json")
# Error in open.connection(con, "rb") :
# SSL certificate problem: certificate has expired
library(rvest)
read_html("https://api.worldbank.org/v2/country?format=json")
# Error in open.connection(con, "rb") :
# SSL certificate problem: certificate has expired
我不确定这是API方面还是R中的某个问题?
答案 0 :(得分:1)
对于其他遇到类似问题的人
网站所有者的SSL证书已过期。
我能够通过this网站进行确认:
由于我无法控制该URL的SSL证书,因此我只是将所有使用的URL从https
更改为http
。
例如:
"https://api.worldbank.org/v2/country?format=json"
更改为
"http://api.worldbank.org/v2/country?format=json"
答案 1 :(得分:0)
我实际上也遇到了这个问题……无论哪种方式,我都无法访问它。我收到以下错误消息(WDIcache()当然也不起作用)
Error in file(con, "r") : cannot open the connection to 'http://api.worldbank.org/indicators?per_page=25000&format=json'