简体   繁体   English

JavaScript获取请求错误:无法加载资源:net :: ERR_CONNECTION_RESET

[英]JavaScript get request error: Failed to load resource: net::ERR_CONNECTION_RESET

So I've been developing my application for a while now, and didn't encounter such an issue until recently this afternoon, when starting application after some changes in the javascript code I got an error while loading a request from server side like this: 因此,我已经开发了一段时间,直到今天下午才遇到这样的问题,在对JavaScript代码进行一些更改后启动应用程序时,从服务器端加载如下请求时出现错误:

错误图片

In the console I am writing readyState and status, and the first two values happen as soon as web page is loaded and other ones come after like 5-10s time out. 在控制台中,我正在编写readyState和status,并且前两个值在加载网页后立即发生,而其他值则在5-10超时后出现。 This is the code that is supposed to be running. 这是应该运行的代码。

 window.addEventListener('load', function() { let xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { console.log(this.readyState); console.log(this.status); if (this.readyState === 4 && this.status === 200) { GetGoals(JSON.parse(this.response), goalsList); } }; xhttp.open('get', '/api/mainmenu', true); xhttp.send(); }); 

I am starting my application on the file and running it on the chrome. 我正在文件上启动我的应用程序,并在chrome上运行它。 While I googled i found some answers talking about certificate mismatch, but why would that happen only after some time? 当我用Google搜索时,我发现了一些有关证书不匹配的答案,但是为什么那会在一段时间后发生呢? How could i solve this issue? 我该如何解决这个问题? I am developing on .NET Core asp.net 2 and vanilla js. 我正在.NET Core asp.net 2和vanilla js上进行开发。

EDIT: It seems that only this get method fails, post method works fine which is even stranger. 编辑:似乎只有此get方法失败,post方法工作正常,甚至更陌生。

Okay, so the issue was different from what I imagined. 好的,这个问题与我的想象不同。 There was an issue with my SQL Servers. 我的SQL Server有问题。 It seems that i might have turned off one or it got turned off somehow and it could not get the request to the database, which is strange indeed. 看来我可能已经关闭了一个,或者以某种方式关闭了它,但无法将请求发送到数据库,这确实很奇怪。

暂无
暂无

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

相关问题 无法加载资源:net::ERR_CONNECTION_RESET in angular - Failed to load resource: net::ERR_CONNECTION_RESET in angular Javascript try-catch无法捕获“无法加载资源:net :: ERR_CONNECTION_RESET” - Javascript try-catch doesn't catch 'Failed to load resource: net::ERR_CONNECTION_RESET ' 无法加载资源:net :: ERR_CONNECTION_RESET node js server - Failed to load resource: net::ERR_CONNECTION_RESET node js server Http请求-> net_error = -101(ERR_CONNECTION_RESET) - Http request --> net_error = -101 (ERR_CONNECTION_RESET) Javascript 套接字(失败:WebSocket 握手期间出错:net::ERR_CONNECTION_RESET) - Javascript Sockets (failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET) 无法加载资源:https://www.google-analytics.com/ga.js中的net :: ERR_CONNECTION_RESET - Failed to load resource: net::ERR_CONNECTION_RESET in https://www.google-analytics.com/ga.js 发出GET请求时出错“无法加载资源:net :: ERR_CONNECTION_REFUSED” - error when making GET request “Failed to load resource: net::ERR_CONNECTION_REFUSED” net::ERR_CONNECTION_RESET, Uncaught (in promise) TypeError: Failed to fetch - net::ERR_CONNECTION_RESET, Uncaught (in promise) TypeError: Failed to fetch jQuery 1.4.2 XHR请求网:: ERR_CONNECTION_RESET - JQuery 1.4.2 XHR request net::ERR_CONNECTION_RESET Django 通道失败:WebSocket 握手期间出错:net::ERR_CONNECTION_RESET - Django Channels failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM