Paste the following code in your Global.asax file
protected void Application_BeginRequest(Object sender, EventArgs e)
{
Request.InputStream.Position = 0;
byte[] buffer = new byte[Request.InputStream.Length];
Request.InputStream.Read(buffer, 0, buffer.Length);
Request.InputStream.Position = 0;
FileStream fs = File.Open("c:\\Projects\\Log.txt", FileMode.Append);
foreach (string key in Request.Headers)
{
string header = key + ": " + Request.Headers[key] + Environment.NewLine;
fs.Write(Encoding.UTF8.GetBytes(header), 0, header.Length);
}
fs.Write(buffer, 0, buffer.Length);
string end = Environment.NewLine + Environment.NewLine;
fs.Write(Encoding.UTF8.GetBytes(end), 0, end.Length);
fs.Close();
}
<ch****@totalise.co.ukwrote in message
news:11*********************@a75g2000cwd.googlegro ups.com...
Hi all,
I want to evaluate the size of the http request sent to my
webservice. How can I accomplish this?
System.Web.HttpContext.Current.Request seems to return the http
request for the browser on the aspx page that the service is called
from, not the call to the service itself.
Any ideas?
Chandy