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 Access-Control-Allow-Headers in preflight response.
原因:前台发送的请求体包含了没有允许的Header
如何解决问题:在请求体加入允许的Header类型
原有代码: response.setHeader(“Access-Control-Allow-Headers”, “x-requested-with,Authorization”);
修改后: response.setHeader(“Access-Control-Allow-Headers”, "x-requested-with,Authorization,language");
Request header field * is not allowed by Access-Control-Allow-Headers in preflight response问题解决的更多相关文章
- 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 ...
- 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 ...
- Request header field Content-Type is not allowed by Access-Control-Allow-Headers
今天遇到一个跨域问题记录学习下: 一.问题: 跨域请求中包含自定义header字段时,浏览器console报错. Request header field xfilesize is not allow ...
- 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 ...
- 浏览器报错问题解决: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 ...
- 解决Bug:Size of a request header field exceeds server limit
用了cms 发现这玩意真不好,老是有各种奇芭的问题跳出来 有时浏览网页时会出现 Bad Request Your browser sent a request that this server cou ...
- 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 ...
- 如何解决出现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 ...
- 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 ...
随机推荐
- uboot是什么
u-boot是一种普遍用于嵌入式系统中的Bootloader,Bootloader是在操作系统运行之前执行的一小段程序,通过它,我们可以初始化硬件设备.建立内存空间的映射表,从而建立适当的软硬件环境, ...
- VMware虚拟化kvm安装部署总结
虚拟化 1.环境 Centos7.3 关闭selinux,关闭防火墙 2.虚拟化环境配置 2.1 kvm部署安装 1. VMware 配置桥接模式 2.bios开启虚拟机,以本地台式机为例, 重启动电 ...
- 纯数据结构Java实现(8/11)(Trie)
欢迎访问我的自建博客: CH-YK Blog.
- 2019年杭电多校第三场 1008题Game(HDU6610+带修改莫队+Nim博弈)
题目链接 传送门 题意 给你\(n\)堆石子,每堆有\(a_i\)堆石子,\(q\)次操作: 在\([L,R]\)内有多少个子区间使得\(Alice\)(先手)在\(Nim\)博弈中获胜: 交换\(a ...
- python应用-输出验证码
from random import randint def generate_code (code_len): """ 生成确定位数的验证码 :param code_l ...
- 记一次PATH环境变量设置不生效的问题
问题:卸载原有版本jdk后,如下图在/etc/profile中配置新的环境变量且source /etc/profile 生效配置后,JAVA_HOME值都正确,但PATH变量值还是不对 echo $P ...
- (21) 树莓派使用python调用命令行 python中调用linux命令及os.system的返回值
cmd = "sudo shutdown -h now"; os.system(cmd)
- [Algorithm] 387. First Unique Character in a String
Given a string, find the first non-repeating character in it and return it's index. If it doesn't ex ...
- vim文本编辑器——替换、保存退出
1.替换: (1)全文替换: 利用查询命令查询: (2)指定替换的字符串的范围: 2.保存.退出命令: (1)在命令行模式下保存(:w) (2)另存为(:w+要保存的文件的路径) (3)保存退出(:w ...
- CentOS里下载和离线安装rpm包
离线下载rpm包 yum --downloadonly --downloaddir=/home/packages install mariadb-devel 安装离线rpm包 进入下载包的 ...