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 2 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 2 months ago

Subscribe

Select Categories