[英]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.