【发布时间】:2018-03-01 14:54:28
【问题描述】:
我正在编写一个使用 JotForm api 系统的 Vue.js 应用程序,但是在使用带有 ApiKey 的 get 请求时出现错误。
这是我的请求代码:
axios.get('https://api.jotform.com/user/forms', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'APIKEY': state.apiKey
} }).then(response => {
console.log(response)
}).catch((error) => {
console.log(error)
})
这是错误信息:
预检响应中的 Access-Control-Allow-Headers 不允许请求标头字段 APIKEY
我在网上搜索并尝试添加各种标题。他们都没有成功。同样的 get 请求也适用于 Postman。
【问题讨论】: