Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me to get respond boy to string?

here is my simple code of httpmodule
C#
public void Init(HttpApplication httpApp)
{
  httpApp.EndRequest += new EventHandler(OnEndRequest);
}
public void OnEndRequest(Object sender, EventArgs e)
{
  HttpApplication httpAppRespond = (HttpApplication)sender; 
     ?
}
Posted
Updated 6-Jul-15 20:07pm
v2
Comments
Shanish K 7-Jul-15 2:19am    
What is it boy to string? what exactly you are trying? can you provide more information?
Eranga Dayarathne 7-Jul-15 2:22am    
I just want to save respond body to text file. before that I want to get respond body string variable.

help me to get respond body. here is the sample I tried

using (Stream receiveStream = httpAppRespond.Context.Response.OutputStream)
{

using (StreamReader readStream = new StreamReader(receiveStream))
{
string respond = readStream.ReadToEnd();
}


}

1 solution

How to use HttpWebRequest and HttpWebResponse in .NET[^] should give you an idea on how to use the response data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900