I am developing .net Core Web Api with Vs Code with Angular 6, Vs Studio. The error is as follows; - Failed to load resource: the server responded with a status of 500 (Internal Server Error) - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http: // localhost: 4200' is therefore not allowed access. The response was HTTP status code 500.
// I added to Startup.cs;
ConfigureServices === >>> services.AddCors ();
Configure === >>>> app.UseCors (bldr => bldr.WithOrigins ("http: //
localhost: 4200") .WithMethods ("GET", "POST"). AllowAnyHeader ());
The problem is that; The problem is resolved in the get method, the data is retrieved but it does not work in the post method. Thanks in advance.