[英]Failed to load resource: net::ERR_CONNECTION_RESET in angular
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
Here I'm doing a webAPI using c#.net where at localhost:44371/api/InsertParticipant.在这里,我正在使用 c#.net 在 localhost:44371/api/InsertParticipant 上做一个 webAPI。
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/测验。
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.