ASP MVC 5 and Json.NET: action return type

后端 未结 5 2054
闹比i
闹比i 2021-01-19 23:14

i\'m using ASP MVC 5. I have an action in a controller that return a json object:

[HttpGet]
public JsonResult GetUsers()
{
  return Json(....., JsonRequestBe         


        
5条回答
  •  滥情空心
    2021-01-20 00:09

    You can use ContentResult instead like this:

    return Content(JsonConvert.SerializeObject(...), "application/json");
    

提交回复
热议问题