如何使用jsonlite将在线JSON数据加载到Shining应用程序?
我正在尝试制作一个从以下api获取数据的闪亮应用程序:。我需要使用jsonlite::fromJSON,因为它有很好的展平功能。当我使用以下代码时(最简单的例子是,在现实生活中,我对数据做了更多的工作): 我尝试了以下方法(绕过ssl验证对等点): 我尝试过的另一个想法是:如何使用jsonlite将在线JSON数据加载到Shining应用程序?,json,r,shiny,jsonlite,Json,R,Shiny,Jsonlite,我正在尝试制作一个从以下api获取数据的闪亮应用程序:。我需要使用jsonlite::fromJSON,因为它有很好的展平功能。当我使用以下代码时(最简单的例子是,在现实生活中,我对数据做了更多的工作): 我尝试了以下方法(绕过ssl验证对等点): 我尝试过的另一个想法是: data=fromJSON(readLines("https://www.riigiteenused.ee/api/et/all")) 它在我的电脑中工作正常,但当我将其上传到shinyapps.io应用程序时,它不工作,
data=fromJSON(readLines("https://www.riigiteenused.ee/api/et/all"))
它在我的电脑中工作正常,但当我将其上传到shinyapps.io应用程序时,它不工作,从日志中我看到错误:
Error in file(con, "r") : https:// URLs are not supported
有没有人能给我一个线索,如果有一种方法可以使用jsonlite fromJSON函数从https toshiny应用程序加载JSON数据
我的会话信息如下:
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=Estonian_Estonia.1257 LC_CTYPE=Estonian_Estonia.1257
[3] LC_MONETARY=Estonian_Estonia.1257 LC_NUMERIC=C
[5] LC_TIME=Estonian_Estonia.1257
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] jsonlite_0.9.19 httr_1.0.0 RCurl_1.95-4.7 bitops_1.0-6 shiny_0.12.2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 digest_0.6.8 mime_0.4 R6_2.1.1
[5] xtable_1.7-4 magrittr_1.5 stringi_1.0-1 curl_0.9.4
[9] tools_3.2.2 stringr_1.0.0 httpuv_1.3.3 rsconnect_0.4.1.4
[13] htmltools_0.2.6
不要跳过ssl,请尝试
fromJSON(content(GET("https://www.riigiteenused.ee/api/et/all"), "text"))
我尝试了这个解决方案,它在我的计算机和闪亮的服务器上运行良好:
library(rjson)
library(jsonlite)
fromJSON(url, flatten=T)
仍然给了我相同的错误:curl::curl\u fetch\u内存中的错误(url,handle=handle):对等证书无法使用给定的CA证书进行身份验证。MM,我不知道如何帮助。那个电话对我有用。想知道是否有一个坏的互动正在做从闪亮的应用程序
Error in file(con, "r") : https:// URLs are not supported
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=Estonian_Estonia.1257 LC_CTYPE=Estonian_Estonia.1257
[3] LC_MONETARY=Estonian_Estonia.1257 LC_NUMERIC=C
[5] LC_TIME=Estonian_Estonia.1257
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] jsonlite_0.9.19 httr_1.0.0 RCurl_1.95-4.7 bitops_1.0-6 shiny_0.12.2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 digest_0.6.8 mime_0.4 R6_2.1.1
[5] xtable_1.7-4 magrittr_1.5 stringi_1.0-1 curl_0.9.4
[9] tools_3.2.2 stringr_1.0.0 httpuv_1.3.3 rsconnect_0.4.1.4
[13] htmltools_0.2.6
fromJSON(content(GET("https://www.riigiteenused.ee/api/et/all"), "text"))
library(rjson)
library(jsonlite)
fromJSON(url, flatten=T)