반응형
MVC Result에서 Json 형태의 결과값을 받고자 할때
Prameter에 의한 아래와 같은 오류가 발생할 수 있따.
This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
위와 같은 문제가 발생 할경우는
Request에 대한 Allow를 해주면 된다.
다음과 같은 형태로 변경 해보자
public ActionResult Index()
{
return Json(data, JsonRequestBehavior.AllowGet)
}
출처: https://devman.tistory.com/entry/MVC4-JSON-Problem-JsonRequestBehavior-to-AllowGet [코딩하는 녀석]
반응형
'ASP.NET' 카테고리의 다른 글
[ASP.NET] 파일 형식 등 기본 사항 (0) | 2020.05.06 |
---|---|
Introducing .NET 5 번역 (0) | 2020.04.23 |
.NET 5.0 시작하기 (0) | 2020.04.23 |
How to return ActionResult with specific View? (not the controller name) / ASP.Net (0) | 2020.04.22 |
MVC4 프레임 워크에서 스크립트와 스타일 링크 거는 법 (0) | 2020.04.07 |