简体   繁体   English

无法加载资源:net::ERR_CONNECTION_RESET in angular

[英]Failed to load resource: net::ERR_CONNECTION_RESET in angular

  1. I'm trying to submit my form which has name and email and submit button.我正在尝试提交我的表单,其中包含姓名和电子邮件以及提交按钮。 When I click on the submit button the page is not redirecting to another page, but instead it shows me this error in console:当我单击提交按钮时,页面没有重定向到另一个页面,而是在控制台中向我显示此错误:

     ERROR HttpErrorResponse {headers: HttpHeaders, status: 0, statusText: "Unknown Error", url: null, ok: false, …} error: ProgressEvent bubbles: false cancelBubble: false cancelable: false composed: false currentTarget: XMLHttpRequest {__zone_symbol__xhrSync: false, __zone_symbol__xhrURL: "http://localhost:44371/api/InsertParticipant", __zone_symbol__loadfalse: Array(1), __zone_symbol__errorfalse: null, __zone_symbol__xhrScheduled: true, …} defaultPrevented: false eventPhase: 0 isTrusted: true lengthComputable: false loaded: 0 path: [] returnValue: true srcElement: XMLHttpRequest {__zone_symbol__xhrSync: false, __zone_symbol__xhrURL: "http://localhost:44371/api/InsertParticipant", __zone_symbol__loadfalse: Array(1), __zone_symbol__errorfalse: null, __zone_symbol__xhrScheduled: true, …} target: XMLHttpRequest {__zone_symbol__xhrSync: false, __zone_symbol__xhrURL: "http://localhost:44371/api/InsertParticipant", __zone_symbol__loadfalse: Array(1), __zone_symbol__errorfalse: null, __zone_symbol__xhrScheduled: true, …} timeStamp: 157745.79999991693 total: 0 type: "error" __proto__: ProgressEvent headers: HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, headers: Map(0)} message: "Http failure response for (unknown url): 0 Unknown Error" name: "HttpErrorResponse" ok: false status: 0 statusText: "Unknown Error"

Failed to load resource : net::ERR_CONNECTION_RESET at localhost:44371/api/InsertParticipant无法加载资源:net::ERR_CONNECTION_RESET at localhost:44371/api/InsertParticipant

  1. Here I'm doing a webAPI using c#.net where at localhost:44371/api/InsertParticipant.在这里,我正在使用 c#.net 在 localhost:44371/api/InsertParticipant 上做一个 webAPI。

  2. When i click on submit the page should redirect from http://127.0.0.1:4200/register to http://127.0.0.1:4200/quiz , but it is not redirecting to http://127.0.0.1:4200/quiz .当我点击提交页面应该从http://127.0.0.1:4200/register重定向到http://127.0.0.1:4200/quiz ,但它没有重定向到http://127.0.0.1:4200/测验

  3. If you need more details I will help you.如果您需要更多详细信息,我会帮助您。
  4. What is the issue in the code?代码中有什么问题?
  5. How to remove the error?如何消除错误? If needed I will give you a screenshot.如果需要,我会给你一个截图。

I faced with the similar problem.我遇到了类似的问题。 In my case the solution was very trivial: Webapi in fact was launched on https ://localhost:44381, but in my js client I tried to fetch data from http://localhost:44381.就我而言,解决方案非常简单:Webapi 实际上是在https ://localhost:44381 上启动的,但是在我的 js 客户端中,我尝试从 http://localhost:44381 获取数据。 So, look carefully to link where your api launched.因此,请仔细查看您的 api 启动位置的链接。

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

相关问题 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 JavaScript获取请求错误:无法加载资源:net :: ERR_CONNECTION_RESET - JavaScript get request error: Failed to load resource: 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 net::ERR_CONNECTION_RESET, Uncaught (in promise) TypeError: Failed to fetch - net::ERR_CONNECTION_RESET, Uncaught (in promise) TypeError: Failed to fetch 随机net :: ERR_CONNECTION_RESET问题 - Random net::ERR_CONNECTION_RESET issues net :: ERR_CONNECTION_RESET与Tomcat 6 - net::ERR_CONNECTION_RESET with Tomcat 6 jQuery:.net::ERR_CONNECTION_RESET - jQuery: net::ERR_CONNECTION_RESET Django 通道失败:WebSocket 握手期间出错:net::ERR_CONNECTION_RESET - Django Channels failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET Javascript 套接字(失败:WebSocket 握手期间出错:net::ERR_CONNECTION_RESET) - Javascript Sockets (failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM