浏览器报错问题解决: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文件,注册时提示如下图
随机推荐
- DataUtils
package com.cc.hkjc.util; import java.text.ParseException;import java.text.SimpleDateFormat;import j ...
- codeforces 667D D. World Tour(最短路)
题目链接: D. World Tour time limit per test 5 seconds memory limit per test 512 megabytes input standard ...
- CodeForces546D:Soldier and Number Game(筛区间素数因子个数和)
Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and giv ...
- [Selenium] 如何使用Chrome Options 定制测试Chrome 浏览器的特定属性 (类似FirefoxProfiles)
Chrome Options 类似于FirefoxProfiles,用于定制待测试的Chrome 浏览器的特定属性 1)如果希望测试某个浏览器插件,可通过addExtensions方式提前加载以.cr ...
- BZOJ_1406_[AHOI2007]密码箱_枚举+数学
BZOJ_1406_[AHOI2007]密码箱_枚举+数学 Description 在一次偶然的情况下,小可可得到了一个密码箱,听说里面藏着一份古代流传下来的藏宝图,只要能破解密码就能打开箱子,而箱子 ...
- Bootstrap-CSS:按钮
ylbtech-Bootstrap-CSS:按钮 1.返回顶部 1. Bootstrap 按钮 本章将通过实例讲解如何使用 Bootstrap 按钮.任何带有 class .btn 的元素都会继承圆角 ...
- bootstrap-Glyphicons 字体图标
使用的方法: 1 引入 font-awesome.css文件 2 fonts文件夹 Bootstrap 假定所有的图标字体文件全部位于 ../fonts/ 目录内(可以在font-awesome.c ...
- sublime text 3中修改tab键为缩进4个空格
1. 菜单栏里点击 Preferences-> Setting-User, 如图 2. 在弹出来的文本里,添加如下两行: { // 注意只有一个大括号,如果之前有属性,如在之前的属性后确保有 , ...
- django QQ认证登录
一.开发环境 django 1.10.2 python3.5.2 django-social-auth 0.3.6 二.申请QQ互联 APPID及SECRECT_KEY 大致步骤: 1.成为QQ互联开 ...
- poj1312dfs基础
就是很简单的DFS-因为数据偏小,上去就是干了 #include <stdio.h> #include <string.h> #include <math.h> # ...