【发布时间】:2021-06-16 15:15:43
【问题描述】:
我想将 API 密钥附加到我的 URL 以授予对数据库的访问权限,问题在于将其附加到文件名
var pivot = new WebDataRocks({
container: "#wdr-component",
toolbar: true,
report: {
dataSource: {
filename: "https://testing-195b.restdb.io/rest/customerdata"
}
}
});
此代码适用于控制台
var settings = {
"async": true,
"crossDomain": true,
"url": "https://testing-195b.restdb.io/rest/customerdata",
"method": "GET",
"headers": {
"content-type": "application/json",
"x-apikey": "60c8b39ee2c96c46a2463581",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
【问题讨论】:
-
有什么问题?
-
我正在使用一个名为 restdb.io 的数据库,生成了一个网页 API 密钥 (CORS),如果要访问我的数据库,我需要它,这里的问题是我使用的是有自己的语法的网络报告工具,我需要找到附加 API 密钥或绕过错误“No 'Access-Control-Allow-Origin”
标签: javascript html backend api-key webdatarocks