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

时间:2018-05-25 21:28:17   收藏:0   阅读:2413

[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 的对象
}

}

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!