본문 바로가기

.NET/.NET API

Web Api Cors OPTIONS Method

nuget에서 해당 라이브러리 설치 Microsoft.AspNet.WebApi.Cors
WebApiConfig.cs 에서 아래 코드 삽입
var enableCorsAttribute = new EnableCorsAttribute("*",
                                               "Origin, Content-Type, Accept",
                                               "GET, PUT, POST, DELETE, OPTIONS");
config.EnableCors(enableCorsAttribute);


web.config 에 origin 관련 데이터 삭제