You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

可在浏览器中无CORS错误调用的示例URL有哪些?

可测试CORS错误的示例域名

当然有,以下几个公开域名在浏览器中发起跨域请求时,必然会触发CORS错误,你可以直接在浏览器控制台测试:

  • http://example.net
  • http://example.org
  • http://bbc.co.uk
  • http://google.com

这些域名的服务器默认不会返回Access-Control-Allow-Origin响应头,所以当你执行跨域请求时,浏览器会因为同源策略限制,抛出和测试example.com时一致的错误。

比如测试example.net的代码:

fetch('http://example.net').then(console.log).catch(console.error);

执行后你会在控制台看到类似这样的错误提示:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://example.net/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
TypeError: NetworkError when attempting to fetch resource.

内容的提问来源于stack exchange,提问作者Ooker

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.25 21:52:02