My Ionic-Angular front end is trying to get data from a C# ASP.NET Webapi, both hosted as Azure App services.
It works fine when using https but not when using http.
I've tried different configurations in my startup.cs, but somehow it doesn't go through:
opt.AddPolicy("CorsPolicy", policy =>
{
policy
.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod();
// policy.AllowAnyHeader().AllowAnyMethod().WithOrigins("http://localhost:8100");
});
opt.AddPolicy("CorsPolicy", policy =>
{
policy
.WithOrigins("https://cappuccinobudget.azurewebsites.net",
"http://cappuccinobudget.azurewebsites.net" )
.AllowAnyHeader()
.AllowAnyMethod();
});
Any tips?