0
我想用Zapier代碼發送HTTP請求來打我的API來做一些GET和POST請求。zappier代碼中的基本http認證
API需要API_KEY在授權頭的形式來了解我的請求。下面是代碼,我跑
var settings = {
"url": "https://<HOST>/api/v1/siteinfo",
"method": "GET",
"headers": {
"authorization": "Basic <TOKEN>",
"cache-control": "no-cache"
}
}
fetch(settings.url, settings)
.then(function (r) {
callback({data: r});
}).catch(callback);
但得到這個錯誤:
什麼是錯我的代碼?