Cors Axios获取请求错误

Cors Axios获取请求错误,cors,axios,Cors,Axios,我正在编写一个Vue.js应用程序,该应用程序使用JotForm api系统,但在使用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(respo

我正在编写一个Vue.js应用程序,该应用程序使用JotForm api系统,但在使用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)
})
这是错误消息:

飞行前响应中的访问控制允许标头不允许请求标头字段APIKEY


我在网上搜索并尝试添加各种标题。他们都没有成功。同样的get请求也适用于Postman。

Chrome阻止对不同域URL的请求,一个选项是将CORS插件添加到Chrome,并使其能够在本地环境中工作


对于生产,您应该尝试不同的解决方案,如代理。

Chrome阻止对不同域URL的请求,一个选项是将CORS插件添加到Chrome,并使其能够在您的本地环境中工作


对于生产,您应该尝试一种不同的解决方案,如代理。

可能重复的可能重复的感谢,我也尝试了axios.get(''+state.apiKey,{headers:{'Content Type':'application/x-www-form-urlencoded;charset=UTF-8'})这段代码,它是有效的。谢谢,我也尝试了axios.get(“”+state.apiKey,{headers:{'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'})这段代码已经运行了。