I am having trouble sending a request to Metabase and getting this error in as a response {“errors”:{“database”:“value must be an integer.”}} although the database in the body is an integer.
I tried passing the payload in its regular format and in the JSON.stringify format but I am getting the same response.
This is because I am using the http from K6 library import http from “k6/http”
Has anybody faced this issue before and how did you solve it?
let params = {
headers: {
"X-Metabase-Session": metabaseId,
},
};
var payload = {
type: "native",
native: {
query: `select * from jobs where project_id = ${projectId} and job_type = 3 order by id desc limit 10`,
"template-tags": {},
},
database: 16,
parameters: [],
};
let url = `${myOptions.metabaseURL}/dataset`;
// let res = http.post(url, JSON.stringify(payload), params);
let res = http.post(url, payload, params);
console.log(payload)
console.log("JSON.stringify(payload)",JSON.stringify(payload))
console.log(JSON.parse(res.body))
console.log((res.body))