I need to send a json file with multiple values and receive it in R using plumber, ive tried this but it doesnt seem to work,
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
I need to send it a an ip address that is Rstudio in Desktop running on aws