浏览器报错问题解决: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 allowed by Access-Control-Allow-Headers in preflight response.

解决方案:
ajax请求时,加上对服务器请求数据格式的限制:
contentType : "application/x-www-form-urlencoded" //发送给服务器的格式
注:
$.ajax contentType 和 dataType , contentType 主要设置你发送给服务器的格式,dataType设置你收到服务器数据的格式。
浏览器报错问题解决:Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight respons的更多相关文章
- 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 ...
- Feign请求中报错:Request header is too large 的解决方案。
现在我们项目中都已迁入spring boot和spring cloud. 服务间调用现在都改成feign的调用方式,但是上次在实际使用过程中出现过:Request header is too larg ...
- 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 ...
- 解决Bug:Size of a request header field exceeds server limit
用了cms 发现这玩意真不好,老是有各种奇芭的问题跳出来 有时浏览网页时会出现 Bad Request Your browser sent a request that this server cou ...
- javascript的倒计时功能中newData().getTime()在iOS下会报错问题解决
javascript的倒计时功能中newData().getTime()在iOS下会报错问题解决 在做移动端时间转化为时间戳时,遇到了一个问题,安卓手机上访问时,能拿到时间戳,从而正确转换时间,而在i ...
- 开着idea,死机了,关机重启。重启之后,重新打开idea报错java.lang.AssertionError:upexpected content storage modification
开着idea,死机了,关机重启.重启之后,重新打开idea报错java.lang.AssertionError:upexpected content storage modification. goo ...
- Windows 7上打开IE浏览器报错:无法启动此程序,因为计算机中丢失api-ms-win-core-path-|1-1-0.dll。尝试重新安装该程序以解决此问题。
Windows 7上打开IE浏览器报错: 1. 重新安装IE11也没有解决该问题 2. 在其他Win7电脑也搜索不到该文件,但是能使用IE浏览器. 3. 从网上找了一个dll文件,注册时提示如下图
随机推荐
- Oracle:ORA-00214
现场数据库服务器突然断电,启动时,提示如下现象: sql>sqlplus / as sysdba sql>startup ORA-00214: controlfile 'E:\oracle ...
- BZOJ_1441_Min_数学+裴蜀定理
BZOJ_1441_Min_数学+裴蜀定理 Description 给出n个数(A1...An)现求一组整数序列(X1...Xn)使得S=A1*X1+...An*Xn>0,且S的值最小 Inpu ...
- [USACO2012 OPEN] Bookshelf
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=2678 [算法] 首先不难想到如下DP : 记f[i]表示前i本书的高度和最小值 显然 ...
- codevs1148传球游戏
传送门 1148 传球游戏 2008年NOIP全国联赛普及组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 白银 Silver 题目描述 Description 上体 ...
- cocos2dx-js 初探 整体流程helloworld.html分析
我们下载的是cocos2dx-js的精简版本,主要是为了分析简单明了,能更清楚的看到架构流程.下载地址:http://cocos2d-x.org/filecenter/jsbuilder/下载轻量版. ...
- pair运用
#include <iostream> #include <string> #include <map> #include <algorithm> us ...
- 使用Ajax选取ListBox的值异步更新视图,并作为表单值提交
一.控制器返回一个ViewBag MultiSelecList值. public ActionResult Create() { ViewBag.ReviewIndexItems = new Mult ...
- View Controller Programming Guide for iOS---(七)---Resizing the View Controller’s Views
Resizing the View Controller’s Views A view controller owns its own view and manages the view’s cont ...
- vim中编辑了代码 但是提示can not write的解决办法和代码对齐办法
方式1: 1 :w /tmp/xxxx(如果是c文件就.c拉) 保存在/tmp下面 2 从tmp中复制到有权限的目录下面 cp /tmp xxxx ./(当前目录) 方式2::w !sudo tee ...
- ASP.NET Core Web API + Angular 仿B站(二)后台模型创建以及数据库的初始化
前言: 本系列文章主要为对所学 Angular 框架的一次微小的实践,对 b站页面作简单的模仿. 本系列文章主要参考资料: 微软文档: https://docs.microsoft.com/zh-cn ...