title: JavaScript get request error: Failed to load resource: net::ERR_CONNECTION_RESET
body: <p>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:</p>
  
  <p><img src="https://i.stack.imgur.com/ki9Q8.png" alt="error image"></p>
  
  <p>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. This is the code that is supposed to be running.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>window.addEventListener('load', function() {
    let xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
      console.log(this.readyState);
      console.log(this.status);
  
      if (this.readyState === 4 &amp;&amp; this.status === 200) {
        GetGoals(JSON.parse(this.response), goalsList);
      }
    };
  
    xhttp.open('get', '/api/mainmenu', true);
    xhttp.send();
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am starting my application on the file and running it on the chrome. While I googled i found some answers talking about certificate mismatch, but why would that happen only after some time? How could i solve this issue? I am developing on .NET Core asp.net 2 and vanilla js. </p>
  
  <p><strong>EDIT:</strong> It seems that only this get method fails, post method works fine which is even stranger.</p>