我想记录请求和响应的值
我的动作
public async Task<ResponseData<object>> litewxLogin([FromBody]LiteWxLoginInput input){
... }
过滤器:
public override void OnActionExecuted(ActionExecutedContext context)
{
string url = context.HttpContext.Request.Host + context.HttpContext.Request.Path + context.HttpContext.Request.QueryString;
string method = context.HttpContext.Request.Method;
var result = context.Result; //This result is empty.
//I wanted to read the body's data stream, but it also failed: "Stream is not readable
}
我无法将流发送到Iactionresult和响应,因为该流是只读的
我通过Bing词典翻译将其发送,希望您能读懂我的意思。
非常感谢您