在镀铬错误:内容类型不受访问控制 - 允许 - 头允许 [英] Error in chrome: Content-Type is not allowed by Access-Control-Allow-Headers
本文介绍了在镀铬错误:内容类型不受访问控制 - 允许 - 头允许的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图发送一个Ajax请求时,得到在Chrome这个错误:
I am getting this error in Chrome when trying to send an ajax request:
Content-Type is not allowed by Access-Control-Allow-Headers
一切工作正常在Firefox。
Everything works fine in Firefox.
谁能帮我解决这个问题?
Can anyone help me to resolve this issue?
推荐答案
我解决了这个问题增加的Apache Web服务器的虚拟主机配置如下设置
I solved the problem adding to Apache Web Server virtual host configuration the following settings
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
这篇关于在镀铬错误:内容类型不受访问控制 - 允许 - 头允许的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文