.

AllowGet JsonRequestBehavior

Getting the following error:
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.

Try to add “JsonRequestBehavior.AllowGet” to your return statement.

public JsonResult GetJsonData()
{
    MetricValue m = new MetricValue();
    m.Error = "234";
    m.SnapshotId = 4;
    return Json(m, JsonRequestBehavior.AllowGet);
}

now my output is:

{"MetricId":0,"SnapshotId":4,"Error":"234","Value":null}

 

What's your thoughts on this?

*

Protected by WP Anti Spam