Why can't I read Http Request Input stream twice?

前端 未结 2 606
一向
一向 2020-12-15 18:18

I was putting in some debugging code to test some things, and then the debug code didn\'t behave as expected. The example below is a simplified code to demonstrate my questi

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-15 19:10

    HttpContext.Current.Request.InputStream.Position=0;

    Once you read the position goes to last value, from there its trying to read second time. So before you read, set the position to zero.

    Hope it helps.

提交回复
热议问题