반응형

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 [코딩하는 녀석]

반응형

+ Recent posts