我正在尝试提交包含姓名,电子邮件和提交按钮的表单。当我单击“提交”按钮时,该页面未重定向到另一个页面,而是在控制台中向我显示此错误:
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"
无法加载资源:net :: ERR_CONNECTION_RESET,位于 本地主机:44371 / api / InsertParticipant
在这里,我正在使用c#.net(位于localhost:44371 / api / InsertParticipant)进行webAPI。
当我单击“提交”时,页面应从http://127.0.0.1:4200/register重定向到 http://127.0.0.1:4200/quiz,但不会重定向到http://127.0.0.1:4200/quiz。