"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request." hatası nasıl çözülür?

08.04.2020 21:41
#AJAX #JQUERY #ASP.NET #MVC #JSON #HATA

"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request." hatası nasıl çözülür?

ASP.NET MVC, kötü niyetli bir kullanıcının JSON Hijacking olarak bilinen bir işlemle yüke erişme şansı olduğundan GET isteğine bir JSON yükü ile yanıt vermenize izin vermez.

Bu sebeple yanıtınızı aşağıdaki gibi değiştirmeniz gerekiyor.


return Json(liste, JsonRequestBehavior.AllowGet);