rjsonio

R httr POST of JSON returns status 400

妖精的绣舞 提交于 2019-12-06 10:17:22
问题 I'm working on a few functions to get data from StatBank Denmark, and their API. They have made a console to test JSON calls and I know the basic_request I parse to JSON in the function dst_get_data works, as I have tested it in the console. I get a "status 400" error and an error message that says that I should "supply object when posting". The code below should make reproducible example. It is the third function (dst_get_data) where I am stuck. dst_meta <- function(table, ..., lang = "en"){

R httr POST of JSON returns status 400

霸气de小男生 提交于 2019-12-04 18:08:49
I'm working on a few functions to get data from StatBank Denmark, and their API . They have made a console to test JSON calls and I know the basic_request I parse to JSON in the function dst_get_data works, as I have tested it in the console. I get a "status 400" error and an error message that says that I should "supply object when posting". The code below should make reproducible example. It is the third function (dst_get_data) where I am stuck. dst_meta <- function(table, ..., lang = "en"){ require(jsonlite) require(httr) dkstat_url <- "http://api.statbank.dk/v1/tableinfo" params <- list(