Request.TotalBytes和HttpContext.Current.Request.ContentLength始终为零

时间:2014-12-24 14:51:01

标签: c# asp.net .net asp.net-mvc paypal

在对ASP.Net网站进行重大升级后,几年内未发生变化的旧代码(paypal IPN)已停止工作

    byte[] param = Request.BinaryRead(HttpContext.Current.Request.ContentLength);
    string strRequest = Encoding.ASCII.GetString(param);

Request.ContentLength总是返回零,Request.TotalBytes也是如此。

我认为这与升级有关 - 将MVC添加到ASP.Net网站,升级到.net 4.5等等。但即使是测试,这些变化也不容易逆转。

什么可能导致Request.TotalBytes和HttpContext.Current.Request.ContentLength始终为零?

0 个答案:

没有答案