How to Enable Cross-Origin Requests (CORS) in ASP.NET Core

Forums .NET CoreHow to Enable Cross-Origin Requests (CORS) in ASP.NET Core
Staff asked 5 years ago

* Go to Startup.cs file and add the below code in Configure method,

app.UseCors(options => options.AllowAnyOrigin());
* Add the below code in ConfigureServices method,
services.AddCors(c =>
{
c.AddPolicy(“AllowOrigin”, options => options.AllowAnyOrigin());
});

Ruchi Patel replied 3 years ago

Subscribe

Select Categories