473,396 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dump the response.

Is there a quick way to see response stream? I need to dump the stream into
a file. Request has the InputStream but Response does not have the same
(OutputStream is write only). Do I have to use a filter?
Nov 19 '05 #1
6 1491
Hey Robert,

Here's a quick and not-too-dirty way to get the response to a file. You'll
need to make sure the ASPNET account has write permissions to the location:

Dim uriString As String = _
"http://msdn.microsoft.com/"
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient
Dim myNameValueCollection As New _
System.Collections.Specialized.NameValueCollection
myNameValueCollection.Add("", "")
Dim responseArray As Byte() = myWebClient.UploadValues _
(uriString, "POST", myNameValueCollection)
' Create an instance of StreamWriter to write text to a file.
Dim sw As System.IO.StreamWriter = New
System.IO.StreamWriter("c:\TestFile.txt")
' Add some text to the file.
sw.Write(System.Text.Encoding.ASCII.GetString(resp onseArray))
sw.Close()

If you need to see more information and don't need it programmatically, try
this add-on to IE:

http://www.blunck.info/iehttpheaders.html

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto
"Robert Strickland" <bs*********@comporium.net> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
Is there a quick way to see response stream? I need to dump the stream
into a file. Request has the InputStream but Response does not have the
same (OutputStream is write only). Do I have to use a filter?


Nov 19 '05 #2
You can use the Filter property of the HttpResponse object. This is a
Stream derived object that you can use to manipulate the outgoing response.
That also means you can take the outgoing response and place it into a file.

http://aspalliance.com/71

HTH,

bill

"Robert Strickland" <bs*********@comporium.net> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
Is there a quick way to see response stream? I need to dump the stream into a file. Request has the InputStream but Response does not have the same
(OutputStream is write only). Do I have to use a filter?

Nov 19 '05 #3
Check out this article, this might help you
http://aspnet.4guysfromrolla.com/articles/091102-1.aspx

--
-Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com

"Robert Strickland" <bs*********@comporium.net> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
Is there a quick way to see response stream? I need to dump the stream into a file. Request has the InputStream but Response does not have the same
(OutputStream is write only). Do I have to use a filter?

Nov 19 '05 #4
Thanks

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:OM****************@TK2MSFTNGP11.phx.gbl...
Hey Robert,

Here's a quick and not-too-dirty way to get the response to a file. You'll
need to make sure the ASPNET account has write permissions to the
location:

Dim uriString As String = _
"http://msdn.microsoft.com/"
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient
Dim myNameValueCollection As New _
System.Collections.Specialized.NameValueCollection
myNameValueCollection.Add("", "")
Dim responseArray As Byte() = myWebClient.UploadValues _
(uriString, "POST", myNameValueCollection)
' Create an instance of StreamWriter to write text to a file.
Dim sw As System.IO.StreamWriter = New
System.IO.StreamWriter("c:\TestFile.txt")
' Add some text to the file.
sw.Write(System.Text.Encoding.ASCII.GetString(resp onseArray))
sw.Close()

If you need to see more information and don't need it programmatically,
try this add-on to IE:

http://www.blunck.info/iehttpheaders.html

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto
"Robert Strickland" <bs*********@comporium.net> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
Is there a quick way to see response stream? I need to dump the stream
into a file. Request has the InputStream but Response does not have the
same (OutputStream is write only). Do I have to use a filter?

Nov 19 '05 #5
Thanks...

"Saravana" <sa******@sct.co.in> wrote in message
news:uH*************@TK2MSFTNGP09.phx.gbl...
Check out this article, this might help you
http://aspnet.4guysfromrolla.com/articles/091102-1.aspx

--
-Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com

"Robert Strickland" <bs*********@comporium.net> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
Is there a quick way to see response stream? I need to dump the stream

into
a file. Request has the InputStream but Response does not have the same
(OutputStream is write only). Do I have to use a filter?


Nov 19 '05 #6
Thanks...

"William F. Robertson, Jr." <th****@nameht.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
You can use the Filter property of the HttpResponse object. This is a
Stream derived object that you can use to manipulate the outgoing
response.
That also means you can take the outgoing response and place it into a
file.

http://aspalliance.com/71

HTH,

bill

"Robert Strickland" <bs*********@comporium.net> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
Is there a quick way to see response stream? I need to dump the stream

into
a file. Request has the InputStream but Response does not have the same
(OutputStream is write only). Do I have to use a filter?


Nov 19 '05 #7

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

Similar topics

0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
0
by: Jonas Oholm (Sweden) | last post by:
Hi I'm using the following ASP-page (taken from http://support.microsoft.com/default.aspx?scid=kb;en-us;216829) to dump client certificates from an SSL connection to a file on the webserver. It...
11
by: MPF | last post by:
Alas, I surrender... In a file from a COBOL dump, which is in ASCII, one of the fields is defined as S9(9) V99 Value +0. The value in this location is 0000018922D, which according to the author...
2
by: Carlos | last post by:
Do I need to use the -b option in pg_dump to dump bytea fields? For a while now I have been routinely using the -b option in pg_dump to back up, restore, and copy my databases because I thought...
7
by: Cyril VELTER | last post by:
I'm trying to dump a database from a 7.1.3 server to a 7.4.2 one. It doesn't works because of difference in COPY format (unless I use -d which is VERY slow on a 16G database). What are the...
3
by: mathewda | last post by:
I'm currently work'n on a project where I'm dynamically generating some HTML as text into a string builder. My ASP page has a <span> tag on it and after I gernerate HTML to my string builder I...
3
by: Reggie | last post by:
I am writing a c++ program that will run multiple *.exe files and dump the results to a file. In my test case, I am using netstat. I am running netstat from my c++ program with the ...
14
by: Sheldon | last post by:
Hi, Can anyone tell me why this script file.c and file.h causes a core dump when it is compiled and run? Any help is appreciated. Sheldon snip....
3
by: Bob Altman | last post by:
I have an application that runs a bunch of programs. Occasionally, one of the programs dies a horrible death due to a coding error of some sort in the program. As things are configured today,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.