Я создал хост в swagger, используя пакет plumber в RI, добавил файл json в качестве запроса get. Но ответ не получен. Параметры поиска не найдены. Код, который я использовал, приведен ниже. Я хочу получить этот файл json (cat (x)) как ответы .. Пожалуйста, помогите ..
library(plumber
)
# myapi.R
#* @get /mean
cat(x)=[{"AutonginMake":"Acura","USMakename":"Acura","AutonginModelcount":5,"USModelcount":6,"Mdlyr":2018},{"AutonginMake":"Aston Martin","USMakename":"Aston Martin","AutonginModelcount":1,"USModelcount":3,"Mdlyr":2018},{"AutonginMake":"Audi","USMakename":"Audi","AutonginModelcount":8,"USModelcount":14,"Mdlyr":2018},{"AutonginMake":"Bentley","USMakename":"Bentley","AutonginModelcount":1,"USModelcount":5,"Mdlyr":2018},{"AutonginMake":"BMW","USMakename":"BMW","AutonginModelcount":10,"USModelcount":38,"Mdlyr":2018},{"AutonginMake":"Buick","USMakename":"Buick","AutonginModelcount":3,"USModelcount":4,"Mdlyr":2018},{"AutonginMake":"Cadillac","USMakename":"Cadillac","AutonginModelcount":7,"USModelcount":6,"Mdlyr":2018},{"AutonginMake":"Chevrolet","USMakename":"Chevrolet","AutonginModelcount":19,"USModelcount":28,"Mdlyr":2018},{"AutonginMake":"Chrysler","USMakename":"Chrysler","AutonginModelcount":7,"USModelcount":10,"Mdlyr":2018},{"AutonginMake":"Dodge","USMakename":"Dodge","AutonginModelcount":13,"USModelcount":11,"Mdlyr":2018},{"AutonginMake":"Ford","USMakename":"Ford","AutonginModelcount":21,"USModelcount":30,"Mdlyr":2018},{"AutonginMake":"GMC","USMakename":"GMC","AutonginModelcount":9,"USModelcount":6,"Mdlyr":2018},{"AutonginMake":"Honda","USMakename":"Honda","AutonginModelcount":9,"USModelcount":15,"Mdlyr":2018},{"AutonginMake":"HUMMER","USMakename":"Hummer","AutonginModelcount":3,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"Hyundai","USMakename":"Hyundai","AutonginModelcount":9,"USModelcount":19,"Mdlyr":2018},{"AutonginMake":"Infiniti","USMakename":"Infiniti","AutonginModelcount":5,"USModelcount":5,"Mdlyr":2018},{"AutonginMake":"Jaguar","USMakename":"Jaguar","AutonginModelcount":1,"USModelcount":9,"Mdlyr":2018},{"AutonginMake":"Jeep","USMakename":"Jeep","AutonginModelcount":7,"USModelcount":7,"Mdlyr":2018},{"AutonginMake":"Kia","USMakename":"Kia","AutonginModelcount":7,"USModelcount":16,"Mdlyr":2018},{"AutonginMake":"Land Rover","USMakename":"Land Rover","AutonginModelcount":4,"USModelcount":6,"Mdlyr":2018},{"AutonginMake":"Lexus","USMakename":"Lexus","AutonginModelcount":11,"USModelcount":8,"Mdlyr":2018},{"AutonginMake":"Lincoln","USMakename":"Lincoln","AutonginModelcount":2,"USModelcount":5,"Mdlyr":2018},{"AutonginMake":"Mazda","USMakename":"Mazda","AutonginModelcount":7,"USModelcount":17,"Mdlyr":2018},{"AutonginMake":"Mercedes-Benz","USMakename":"Mercedes-Benz","AutonginModelcount":11,"USModelcount":16,"Mdlyr":2018},{"AutonginMake":"Mercury","USMakename":"Mercury","AutonginModelcount":5,"USModelcount":5,"Mdlyr":2018},{"AutonginMake":"MINI","USMakename":"Mini","AutonginModelcount":2,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"Mitsubishi","USMakename":"Mitsubishi","AutonginModelcount":6,"USModelcount":12,"Mdlyr":2018},{"AutonginMake":"Nissan","USMakename":"Nissan","AutonginModelcount":12,"USModelcount":24,"Mdlyr":2018},{"AutonginMake":"Pontiac","USMakename":"Pontiac","AutonginModelcount":7,"USModelcount":4,"Mdlyr":2018},{"AutonginMake":"Porsche","USMakename":"Porsche","AutonginModelcount":3,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Saab","USMakename":"Saab","AutonginModelcount":2,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Saturn","USMakename":"Saturn","AutonginModelcount":5,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Scion","USMakename":"Scion","AutonginModelcount":3,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Subaru","USMakename":"Subaru","AutonginModelcount":5,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Suzuki","USMakename":"Suzuki","AutonginModelcount":3,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Toyota","USMakename":"Toyota","AutonginModelcount":16,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Volkswagen","USMakename":"Volkswagen","AutonginModelcount":7,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Volvo","USMakename":"Volvo","AutonginModelcount":2,"USModelcount":0,"Mdlyr":2018},{"AutonginMake":"Alfa Romeo","USMakename":"Alfa Romeo","AutonginModelcount":0,"USModelcount":9,"Mdlyr":2018},{"AutonginMake":"Alpina","USMakename":"Alpina","AutonginModelcount":0,"USModelcount":3,"Mdlyr":2018},{"AutonginMake":"Ascari","USMakename":"Ascari","AutonginModelcount":0,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"Citroen","USMakename":"Citroen","AutonginModelcount":0,"USModelcount":12,"Mdlyr":2018},{"AutonginMake":"Dacia","USMakename":"Dacia","AutonginModelcount":0,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"Daewoo","USMakename":"Daewoo","AutonginModelcount":0,"USModelcount":7,"Mdlyr":2018},{"AutonginMake":"Daihatsu","USMakename":"Daihatsu","AutonginModelcount":0,"USModelcount":7,"Mdlyr":2018},{"AutonginMake":"Ferrari","USMakename":"Ferrari","AutonginModelcount":0,"USModelcount":4,"Mdlyr":2018},{"AutonginMake":"Fiat","USMakename":"Fiat","AutonginModelcount":0,"USModelcount":18,"Mdlyr":2018},{"AutonginMake":"Geely","USMakename":"Geely","AutonginModelcount":0,"USModelcount":1,"Mdlyr":2018},{"AutonginMake":"Holden","USMakename":"Holden","AutonginModelcount":0,"USModelcount":6,"Mdlyr":2018},{"AutonginMake":"Isuzu","USMakename":"Isuzu","AutonginModelcount":0,"USModelcount":4,"Mdlyr":2018},{"AutonginMake":"Koenigsegg","USMakename":"Koenigsegg","AutonginModelcount":0,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"Lada","USMakename":"Lada","AutonginModelcount":0,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"Lamborghini","USMakename":"Lamborghini","AutonginModelcount":0,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"Lancia","USMakename":"Lancia","AutonginModelcount":0,"USModelcount":3,"Mdlyr":2018},{"AutonginMake":"Lotus","USMakename":"Lotus","AutonginModelcount":0,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"Maserati","USMakename":"Maserati","AutonginModelcount":0,"USModelcount":5,"Mdlyr":2018},{"AutonginMake":"Maybach","USMakename":"Maybach","AutonginModelcount":0,"USModelcount":2,"Mdlyr":2018},{"AutonginMake":"MG","USMakename":"MG","AutonginModelcount":0,"USModelcount":5,"Mdlyr":2018},{"AutonginMake":"Morgan","USMakename":"Morgan","AutonginModelcount":0,"USModelcount":1,"Mdlyr":2018},{"AutonginMake":"Opel","USMakename":"Opel","AutonginModelcount":0,"USModelcount":16,"Mdlyr":2018},{"AutonginMake":"Pagani","USMakename":"Pagani","AutonginModelcount":0,"USModelcount":1,"Mdlyr":2018},{"AutonginMake":"Panoz","USMakename":"Panoz","AutonginModelcount":0,"USModelcount":1,"Mdlyr":2018},{"AutonginMake":"Peugeot","USMakename":"Peugeot","AutonginModelcount":0,"USModelcount":12,"Mdlyr":2018}]
normalMean <- function(get){
cat(x)
}
r <- plumb("/home/vishnu/Music/importand innovation/rplumber API creation/myapi.R")
r
r$run(port=8000)