码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2018-05-25 21:28:17      阅读:2413      评论:0      收藏:0      [点我收藏+]

标签:stream   反序列化   ali   toe   serial   serialize   ring   temp   end   

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

}

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

标签:stream   反序列化   ali   toe   serial   serialize   ring   temp   end   

原文地址:https://www.cnblogs.com/fishyues/p/9090158.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!