(1)获取post的body参数
// 执行action前的过滤器方法
public void OnActionExecuting(ActionExecutingContext context)
{
// 获取request对象
HttpRequest request = context.HttpContext.Request;
//-- 由于mvc里已经读过request.Body,现在它的position在末尾
// 允许重新读body
request.EnableRewind();
// 将position置到开始位置
equest.Body.Position = 0;
// 读取body的数据流,并转为string
var reader = new StreamReader(request.Body);
var contentFromBody = reader.ReadToEnd();
} // 执行action前的过滤器方法
p