System.Web.Http.corsをNuGet。
WebConfigに、Customheaderを追加すればよいだけ。
WebApiConfig.cs
using System.Web.Http;
namespace t2tr
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.EnableCors();
}
}
}
Controllers.xxxController.cs
[EnableCors(origins: "*", headers: "*", methods: "*")]
public class XxxController : ApiController
{
}