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

}

猜你喜欢

转载自www.cnblogs.com/fishyues/p/9090158.html
今日推荐