asp.net mvc post 接受 传输过来的json数据 并序列化为dynamic 方便访问 一句代码

[HttpPost]
public ActionResult Login()
{
    var form = JsonConvert.DeserializeObject<dynamic>(new StreamReader(Request.InputStream).ReadToEnd());
    string username = form.username;
    string password = form.password;
    ....
}

posted @ 2019-10-30 22:57  ToLing·  阅读(453)  评论(0编辑  收藏  举报