我编写了一个使用JotForm api系统的Vue.js应用程序,但在使用ApiKey获取请求时出现错误。Axios 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)
})
而这是错误消息:
请求头字段APIKEY不是由接入控制允许接头在预检响应允许
我在网上搜索并尝试添加各种标题。他们都没有成功。同样的获取请求与邮差完美匹配。
[请求标头字段Access-Control-Allow-Headers在预检响应中本身不允许]的重复(https://stackoverflow.com/questions/32500073/request-header-field-access-control-allow -headers-is-not-allowed-by-its-in-pr) – Terry