Web 要求をログに記録する IHttpModule を作成しました。POSTリクエストを問題なく記録します。ただし、GET 要求の場合、長さは常にゼロのようです。GET リクエストの長さを取得する方法はありますか?
public void Init(HttpApplication context)
{
context.BeginRequest += ContextBeginRequest;
}
private void ContextBeginRequest(object sender, EventArgs e)
{
string url = app.Request.RequestContext.HttpContext.Request.Url.ToString();
string requestType = app.Request.RequestContext.HttpContext.Request.RequestType;
long requestLength = app.Request.InputStream.Length;
Log(url, requestType, requestLength);
}