webapi 获取请求参数

原文地址:https://www.thinbug.com/q/49611638

 

//获取请求消息提数据 
Stream stream = Request.Content.ReadAsStreamAsync().Result;
Encoding encoding = Encoding.UTF8;
stream.Position = 0;
using (var reader = new StreamReader(stream, encoding))
{
Log.Info(reader.ReadToEnd());
}

posted @ 2021-11-19 19:48  lizhigang  阅读(198)  评论(0编辑  收藏  举报