I post a api to get data, the response like json format, but the Content-Type was text/html
This is my code:
public ActionResult Test(string id)
{
var request = GetMyRequest(id);
RestClient client = new RestClient("baseUrl");
var result = client.Execute(request).Content;
var result2 = JObject.Parse(result);
return Json(result2, JsonRequestBehavior.AllowGet);
}
I got the result
How can i deserialize the response correctly

resultbefore deserialization.JavaScriptSerializerwhich will not know how to serialize aJObject. To switch to Json.NET see Setting the Default JSON Serializer in ASP.NET MVC or Using JSON.NET as the default JSON serializer in ASP.NET MVC 3 - is it possible?. Or try Exception converting JSON.NET JObject to JsonResult for a single method.