How to Peek at Entire HttpRequest.InputStream?

S

samtilden

I want to print out some tracing messages from
Global.asax.cs/Application_BeginRequest().

I easily got:

System.Web.HttpContext.Current.Request.RawUrl, and
System.Web.HttpContext.Current.Request.Params["HTTP_SOAPACTION"].


I would now like to get the entire:

System.Web.HttpContext.Current.Request.InputStream

.... and reset the InputStream back to the beginning so that the rest of
our application will continue to work as before.


I've tried doing:

Request.BinaryRead(length),
Request.InputStream.Position = 0,
Request.InputStream.Seek(0,SeekOrigin.Begin),

but none of them reset the stream pointer back to the beginning.

How can I peek at the _entire_ HttpRequest.InputStream _and_ leave it
untouched?
 
B

bruce barker \(sqlwork.com\)

its a firehose stream, so you can not reset it. you can write you own
handler, then buffer the stream, by reading and writing to another stream
the the request uses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top