ASP.NET에서 JSON 정적 컨텐트 노출
현재 ASP.NET 웹 응용프로그램은 기본적으로 확장자가 json
인 파일에 대한 MIME 맵이 설정되어있지 않습니다. 그래서 브라우저에서 JSON 정적 컨텐트에 접근하려하면 404.3 상태가 반환됩니다.
HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
이 문제는 웹 응용프로그램의 web.config
파일에 아래처럼 JSON 정적 컨텐트에 대한 설정을 추가하면 해결됩니다.
<system.webServer> <staticContent> <mimeMap fileExtension=".json" mimeType="application/json"/> </staticContent> </system.webServer>