473,652 Members | 3,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Peek at Entire HttpRequest.Inp utStream?

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

I easily got:

System.Web.Http Context.Current .Request.RawUrl , and
System.Web.Http Context.Current .Request.Params["HTTP_SOAPACTIO N"].
I would now like to get the entire:

System.Web.Http Context.Current .Request.InputS tream

.... 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.BinaryR ead(length),
Request.InputSt ream.Position = 0,
Request.InputSt ream.Seek(0,See kOrigin.Begin),

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

How can I peek at the _entire_ HttpRequest.Inp utStream _and_ leave it
untouched?

Jun 21 '06 #1
1 8100
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.

<sa*******@gmai l.com> wrote in message
news:11******** **************@ c74g2000cwc.goo glegroups.com.. .
I want to print out some tracing messages from
Global.asax.cs/Application_Beg inRequest().

I easily got:

System.Web.Http Context.Current .Request.RawUrl , and
System.Web.Http Context.Current .Request.Params["HTTP_SOAPACTIO N"].
I would now like to get the entire:

System.Web.Http Context.Current .Request.InputS tream

... 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.BinaryR ead(length),
Request.InputSt ream.Position = 0,
Request.InputSt ream.Seek(0,See kOrigin.Begin),

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

How can I peek at the _entire_ HttpRequest.Inp utStream _and_ leave it
untouched?

Jun 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
5432
by: wizofaus | last post by:
Is the any reason according to the standard that calling tellg() on an std::ifstream after a call to peek() could place the filebuf in an inconsistent state? I think it's a bug in the VC7 dinkumware implementation (and I've reported to them as such), but the following code std::ofstream ofs("test.txt"); ofs << "0123456789"; ofs.close(); std::wifstream ifs("test.txt");
4
11569
by: Daniel Rimmelzwaan | last post by:
I am having trouble getting the XML out of an HttpRequest object. I am sending the XML from biztalk into my aspx page, after which I want to take the XML out of it and process it using a MSXML.DOMDocument. I understand that in the Request object, it is stored as a binary, and I can't figure out how to translate it into a text string. Do I need to read it into a byte variable and then move it to the DOMDocument, or is there a method I...
4
1574
by: Peter Strøiman | last post by:
Hi. I have an ASP page that will receive a lot of post data ( sometimes many MB! ). The ASP page processes the data sequentially, but does not need the entire data stored in memory. Therefore it is cruicial that executing the ASP page doesn't wait for the entire request to arrive. Then I would just begin to chunk my way through the Request.InputStream.
1
2121
by: Matt | last post by:
Does anyone know how to get the whole request stream when data is posted to a web page? I need the HTTP Headers as well in the InputStream when receiving the data into my web page. I know I can get the HTTP headers from the collection but I would like to get the stream as a single item. Thanks, Matt
1
2257
by: SteveR | last post by:
I need some help getting started POSTing data from aspx page. From an aspx page (Send.aspx), I would like POST the contents of a file (i.e., file resides in some directory) to another page (Process.aspx). The other page would read the contents of the InputStream (?), process the data within the stream, and send a response back to the requesting URI. How do I form the request the request in Send.aspx?
0
999
by: davidw | last post by:
Is there a way to get contentype from HttpRequest.InputStream? Thanks!
2
2751
by: jjouett | last post by:
I'm trying to setup an ASPX web page to service requests from an existing Java Client that posts multi-part data as a way to upload files, and I can't find a straightforward way to process the request. >From the HttpRequest, the Request.Form and Request.Files collections are empty. The Request.ContentType states the following: multipart/form-data, boundary=012AhbCfFg225929 and using the Request.InputStream to get the content results in...
0
1232
by: raheel javed | last post by:
i am using mobile for communication with live server when mobile send its information to server the input stream is encoded in utf-8 that is converted into string but it is still not understandable so chk it what should i do to convert such type of data Stream str; string strmContents= ""; int counter, strLen, strRead;
2
2282
by: Terry Reedy | last post by:
Luis Zarrabeitia wrote: Interesting observation. Iterators are intended for 'iterate through once and discard' usages. To zip a long sequence with several short sequences, either use itertools.chain(short sequences) or put the short sequences as the first zip arg. To test without consuming, wrap the iterator in a trivial-to-write one_ahead or peek class such as has been posted before.
0
8367
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8279
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8589
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.