今天下午,本来打算使用aioxs在header里传一个token给后台服务器,如下图所示:

结果,控制台报了如下的错:

然后,我不停地百度,不停的改后台express的header设置,一直没有效果;

最后,我才发现,我只要在原来的header设置里加多一个‘token’就可以了;

具体思路我是参考了这个链接:https://segmentfault.com/q/1010000015572348?sort=created

header field token is not allowed by Access-Control-Allow-Headers in preflight response问题解决的更多相关文章

  1. Failed to load http://localhost:8080/team.php: Request header field x-jwt-header is not allowed by Access-Control-Allow-Headers in preflight response.

    axios 加入header之后,请求出现 Failed to load http://localhost:8080/team.php: Request header field x-jwt-head ...

  2. axios跨域请求报错:Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

    在做项目时,用到axios,数据用post提交时,老是报错,错误提示为: Access to XMLHttpRequest at 'http://127.0.0.1:3000/api/add' fro ...

  3. post请求(headers里有属性)报错:Request header field xxx is not allowed by Access-Control-Allow-Headers in preflight response

    post 请求,headers里有属性(xxx).请求时报错: XMLHttpRequest cannot load <url>. Request header field xxx is ...

  4. Request header field Content-Type is not allowed by Access-Control-Allow-Headers

    今天遇到一个跨域问题记录学习下: 一.问题: 跨域请求中包含自定义header字段时,浏览器console报错. Request header field xfilesize is not allow ...

  5. 浏览器报错问题解决:Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight respons

    FAQ: Failed to load http://www.erpshop.com/index.php: Request header field Content-Type is not allow ...

  6. Request header field * is not allowed by Access-Control-Allow-Headers in preflight response问题解决

    跨域问题报错信息为:Failed to load http://192.168.30.119: Request header field language is not allowed by Acce ...

  7. 9.如何解决出现AXIOS的Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.

    问题描述: 由于restful接口需要在头部header传递两个字段: Content-Type: application/jsonAccess-Token: 84c6635800b14e0eba4f ...

  8. 如何解决出现AXIOS的跨域问题:Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.

    转载:https://www.cnblogs.com/caimuqing/p/6733405.html 问题描述: 由于restful接口需要在头部header传递两个字段: Content-Type ...

  9. has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.

    https://www.cnblogs.com/caimuqing/p/6733405.html // TODO 支持跨域访问 response.setHeader("Access-Cont ...

随机推荐

  1. Oracle 实例管理

    理解初始化参数文件实例由内存中构建它的参数来定义.许多参数(但不是全部)可以在启动后更改.有些参数在启动时就固定了,只能在关闭实例并再次启动时更改. 静态和动态参数文件参数文件由两类:静态参数文件(也 ...

  2. 浅谈 Virtual DOM 的那些事

    背景 我们都知道频繁的dom给我们带来的代价是昂贵的,例如我们有时候需要去更新Table 的部分数据,必须去重新重绘表格,这代价实在是太大了,相比于频繁的手动去操作dom而带来性能问题,vdom很好的 ...

  3. C++笔记020:const 和 #define 的对比

      原创笔记,转载请注明出处! 点击[关注],关注也是一种美德~ 第一,const与#define的相同点 C++中的const常量类似于宏定义 const  int  c = 5  ≍  #defi ...

  4. ABAP术语-Update Data

    Update Data 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/20/1114169.html The data which is t ...

  5. ubuntu 安装linux 下vmVMware tools 步骤及问题解决

    一. 菜单栏     “虚拟机” ——> “设置 ”     使用linux.so镜像文件    此文件在vmware workstation 的安装目录.并且打开CD/DVD的连接. 二.终端 ...

  6. js时间与毫秒互相转换

    1)日期转换为毫秒 如果格式是:yyyy/mm/dd hh:mm:ss可以直接转换.var oldTime = (new Date("2018/07/09 14:13:11")). ...

  7. html-表单标签

    表单标签 * 可以提交数据到**网站上的服务器,这个过程可以使用表单标签实现 * <form></form>:定义一个表单的范围 - 属性 ** action:提交到地址,默认 ...

  8. Quick find Helper

    using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; /// <summary> /// 视图 ...

  9. 我一个自己的关于II和&&的逻辑判断(傻逼型)

    原因 首先概述下起始原因:本来埋点的数据中传递来的URL只有http://开头的数据,所以上一个编写此程序的人在定义产品ID和出发口岸时加了这样的判断 然后...悲剧(傻逼)开始了 因为业务需求,埋点 ...

  10. 调试日志——基于stm32的智能声光报警器(三)

    智能声光报警器基本功能调试完成. 1.通过拨码开关来设置LED闪烁的频率. 2.关门时喇叭不想,灯熄灭. 3.旁路模式时,灯处于闪烁状态,此时关门灯扔闪烁. 关于此次代码我觉得还是有可以优化的地方,电 ...