javascript - 标头中不包含授权标头
问题描述
我正在尝试向 oxford dictionary api 发送请求,但我无法传递自动标头。
这是我写的函数
function testResults (form) {
var TestVar = form.inputbox.value;
alert ("You typed: " + TestVar);
var url='https://od-api.oxforddictionaries.com:443/api/v1/';
url = url+"?word_id="+encodeURIComponent(TestVar);
word=fetch(url, {
method: 'GET',
mode: 'no-cors',
headers: new Headers({
'app_id': 'id',
'app_key': 'key'
})
})
word.then(function(response){
console.log(response)
return response.json();
}).then(function(resJson){
console.log(resJson);
})
}
我在通过的开发人员工具中看不到它,并且收到 403 响应,
解决方案
推荐阅读
- git - 更改分支时配置自动等效于 git stash git apply
- python - jinja2 渲染空里
- sharepoint - SharePoint 经典团队网站 -> Azure Functions 中的 Office 365 组
- c# - 使用 EWS 将联机会议属性设置为约会对象
- sass - 如何在 sass 中仅选择当前班级的第一个最近的父级
- terraform - 如何将 Terraform 状态漂移合并回配置文件?
- vim - vim 删除到行尾前一个字符
- c# - .NET Directory.CreateDirectory 引发 UnauthorizedAccessException;用户可以使用 Windows 资源管理器创建目录
- apache-beam - 在 Apache Beam 中使用 ParDo 上的计时器和侧面输入
- highcharts - Highcharts 绘制每周数据 (JS)