Request header field Content-Type is not allowed by Access-Control-Allow-Headers跨域
生活随笔
收集整理的這篇文章主要介紹了
Request header field Content-Type is not allowed by Access-Control-Allow-Headers跨域
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
跨域錯誤提示:
XMLHttpRequest cannot load http://xxx.com. Request header field Content-Type is not allowed by Access-Control-Allow-Headers.
解決方案:
例如php服務端程序設置頭:
header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE');總結
以上是生活随笔為你收集整理的Request header field Content-Type is not allowed by Access-Control-Allow-Headers跨域的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 分块查询 缓解内存开销
- 下一篇: 斐波那契数列的两种实现呢