简体   繁体   English

仅在Chrome中出现错误:XMLHttpRequest无法加载资源

[英]Error in Chrome only: XMLHttpRequest failed to load resource

I am running a WebApi and a WebClient application under IIS express (localhost) and receive this error only when I run them under Chrome. 我在IIS express(localhost)下运行WebApi和WebClient应用程序,并且仅当我在Chrome下运行它们时才收到此错误。 It works fine under IE. 在IE下工作正常。

At this point I am attempting to just log in a user and I receive two error messages that I am not sure what they mean - 在这一点上,我尝试仅登录用户,并且收到两条错误消息,我不确定它们是什么意思-

Failed to load resource: http://localhost:59822/api/accounts/login the server responded with a status of 401 (Unauthorized) 无法加载资源: http:// localhost:59822 / api / accounts / login服务器以401(未授权)状态响应

XMLHttpRequest cannot load http://localhost:59822/api/accounts/login . XMLHttpRequest无法加载http:// localhost:59822 / api / accounts / login Invalid HTTP status code 401 无效的HTTP状态代码401

This most likely happens due to the security settings in Chrome. 这很可能是由于Chrome中的安全设置所致。

By default the same-origin policy is rigorously enforced. 默认情况下,严格执行同源策略

Here is how to disable it in Chrome. 以下是在Chrome中禁用它的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Safari的XMLHttpRequest“无法加载资源” - XMLHttpRequest “Failed to load resource” with Safari WKWebView XMLHttpRequest 加载资源失败 - WKWebView XMLHttpRequest Failed to load resource 选项资源加载失败,仅适用于Chrome浏览器 - OPTIONS Resource failed to load, only in chrome 仅限Chrome中的错误:XMLHttpRequest无法加载文件网址请求的资源上没有“Access-Control-Allow-Origin”标头 - Error in Chrome only: XMLHttpRequest cannot load file URL No 'Access-Control-Allow-Origin' header is present on the requested resource 带有JQ的Ajax请求在Chrome中显示错误:“无法加载资源” - Ajax request with JQ gives an error in Chrome: “Failed to load resource” 无法加载资源错误 - Failed To Load Resource Error vs2008中没有错误但在Chrome中错误= XMLHttpRequest无法加载文件:仅支持HTTP的跨源请求 - no error in vs2008 but in Chrome Error= XMLHttpRequest cannot load file: Cross origin requests are only supported for HTTP XMLHttpRequest无法加载具有安全性检查的Chrome本地主机资源 - XMLHttpRequest cannot load localhost resource with security check is Chrome 无法在Chrome中加载资源+ $ .ajax调用 - Failed to load resource + $.ajax call in Chrome 在控制台中抑制 Chrome 的“无法加载资源”消息 - Suppress Chrome 'Failed to load resource' messages in console
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM