asp.net
Microsoft.AspNetCore.Cors
Startup.cs
add services.AddCors();
public void ConfigureServices(IServiceCollection services)
{
services.AddCors();
}
add app.UseCors
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseCors(builder => builder
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
app.UseCors(
options => options.WithOrigins("http://example.com").AllowAnyMethod()
);
app.UseMvc();
}