【发布时间】:2023-03-10 16:47:01
【问题描述】:
我需要发送一个包含多个值的 json 文件并使用管道工在 R 中接收它,我试过了,但它似乎不起作用,
library("rjson")
#install.packages("rjson")
#* @get /predict
#* @post /predict
function(predict) {
# Load the package required to read JSON files.
library("rjson")
# Give the input file name to the function.
result <- fromJSON(file = "input_v3.json")
print(result)
result <- as.data.frame(result)
write.table(result, file="testing_v3_xyz.csv", sep=",", row.names=FALSE, col.names=TRUE, append = T)
}
The curl command i used is curl -F data=@input_v3.json http://xx.xxx.xxx.xx:8000/predict
我需要向它发送一个 IP 地址,即在 aws 上运行的 Desktop 中的 Rstudio
【问题讨论】: