Last post Aug 01, 2020 04:39 PM by bruce (sqlwork.com)
None
0 Points
1 Post
Aug 01, 2020 12:35 AM|pablo.the.souza|LINK
Hey folks I'm using Cors to get my angular application to interact with the database through .NET WebAPI but I'm getting the following error:
core.js:4197 ERROR HttpErrorResponse {headers: HttpHeaders, status: 0, statusText: "Unknown Error", url: "https://localhost:44398/api/main_tb", ok: false, …} error: ProgressEvent {isTrusted: true, lengthComputable: false, loaded: 0, total: 0, type: "error", …} headers: HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, headers: Map(0)} message: "Http failure response for https://localhost:44398/api/main_tb: 0 Unknown Error" name: "HttpErrorResponse" ok: false status: 0 statusText: "Unknown Error" url: "https://localhost:44398/api/main_tb" __proto__: HttpResponseBase
Here's the post on the controller:
[ResponseType(typeof(main_tb))] public IHttpActionResult Postmain_tb(main_tb main_tb) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.main_tb.Add(main_tb); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = main_tb.SleepId }, main_tb);
Let me know if I need to post the angular code for more info. Any help is appreciated.
All-Star
58154 Points
15646 Posts
Aug 01, 2020 04:39 PM|bruce (sqlwork.com)|LINK
You should use the browsers network trace to see the actual response.
None
0 Points
1 Post
Angular + .NET POST error:
Aug 01, 2020 12:35 AM|pablo.the.souza|LINK
Hey folks I'm using Cors to get my angular application to interact with the database through .NET WebAPI but I'm getting the following error:
Here's the post on the controller:
Let me know if I need to post the angular code for more info. Any help is appreciated.
All-Star
58154 Points
15646 Posts
Re: Angular + .NET POST error:
Aug 01, 2020 04:39 PM|bruce (sqlwork.com)|LINK
You should use the browsers network trace to see the actual response.