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 ...
随机推荐
- Httpd服务入门知识-Httpd服务常见配置案例之虚拟主机
Httpd服务入门知识-Httpd服务常见配置案例之虚拟主机 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.虚拟主机实现方案 1>.Apache httpd 有三种实现虚 ...
- k8s管理存储资源
1. Kubernetes 如何管理存储资源 理解volume 首先我们学习 Volume,以及 Kubernetes 如何通过 Volume 为集群中的容器提供存储:然后我们会实践几种常用的 Vol ...
- SpringBoot项目的测试类
1. package soundsystem; import static org.junit.Assert.*; import org.junit.Test; import org.junit.ru ...
- Spring Cloud Stream 知识点
发布-订阅模式 在Spring Cloud Stream中的消息通信方式遵循了发布-订阅模式,当一条消息被投递到消息中间件之后,它会通过共享的Topic主题进行广播,消息消费者在订阅的主题中收到它并触 ...
- 20180516模拟赛T1——queen
题解 这题显然是\(总方案数不可行方案数总方案数-不可行方案数\)(直接算是无规则的).总方案数是\(n^2m^2\),于是问题就在于不可行的方案数. 若queen落在一个点上,则横竖是十分好求的(\ ...
- 牛客NOIP暑期七天营-提高组5
A:deco的abs. 水题,先%,然后相邻两个数min()一下差值. #include<bits/stdc++.h> #define ll long long using namespa ...
- 内存模型学习-- Container Executor task之间的关系
(分割线前的都是废话) java8内存模型: http://www.cnblogs.com/paddix/p/5309550.html http://www.cnblogs.com/dingyings ...
- Python3.x保留字(33个)
- http-server开启测试服务器
一.安装 npm install --global http-server 二.查看使用帮助 hs -h 三.基本使用 ①默认开启占用8080端口启动一个服务器,直接打开浏览器 hs -o ②指定都端 ...
- 为什么很多人坚信“富贵险中求”?
之家哥 2017-11-15 09:12:31 微信QQ微博 下载APP 摘要 网贷之家小编根据舆情频道的相关数据,精心整理的关于<为什么很多人坚信"富贵险中求"?>的 ...