How to enable CORS in ASP.net WebAPI code example
Example 1: enable cors asp.net mvc
public static void Register(HttpConfiguration config)
{
var corsAttr = new EnableCorsAttribute("http://example.com", "*", "*");
config.EnableCors(corsAttr);
}
Example 2: enable cors asp.net mvc
public static void Register(HttpConfiguration config)
{
// New code
config.EnableCors();
}