• 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.

浏览器报错问题解决:Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight respons

  • 解决方案:

ajax请求时,加上对服务器请求数据格式的限制:

contentType : "application/x-www-form-urlencoded" //发送给服务器的格式
  • 注:

$.ajax contentType 和 dataType , contentType 主要设置你发送给服务器的格式,dataType设置你收到服务器数据的格式。

相关文章:

  • 2021-10-08
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
猜你喜欢
  • 2022-12-23
  • 2021-04-03
  • 2021-08-28
  • 2021-06-30
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案