I have a function that takes in a character vector as argument and after processing returns a result.
I want to expose it as an API using plumber. How to I pass a JSON as input
I have used the following code
file_recommender = function(req,res,files){
files = as.data.frame(files)
files = files$name
files = as.character(files)
library(dplyr)
return(files)
}
In the http request I am sending the data as
http://127.0.0.1:8000/get_file_recommendation?files=[{"name":"pvdxmanager.h"}]
http://127.0.0.1:8000/get_file_recommendation?files={name":["pvsignmanager.cpp","pvdxmanager.cpp","pvorderoperationsmanager.h"]}