.net core 中后台获取前台 数据(post)的方法

[HttpPost]
public async Task<JsonResult> EditPoint()
{
Stream reqStream = Request.Body;
string text = "";
using (StreamReader reader = new StreamReader(reqStream))
{
text = reader.ReadToEnd();  ///这里的 text 就是 json字符串,然后在 后台反序列化 成 对象 就可以了

 JSonfor tempdata = JsonConvert.DeserializeObject<JSonfor>(text);  ////反序列化为 JSonfor 的对象
}

}

posted @ 2018-05-25 18:19  翱翔的小鱼  阅读(902)  评论(0编辑  收藏  举报