Paste the following code in your Global.asax file
protected void Application_Beg inRequest(Objec t sender, EventArgs e)
{
Request.InputSt ream.Position = 0;
byte[] buffer = new byte[Request.InputSt ream.Length];
Request.InputSt ream.Read(buffe r, 0, buffer.Length);
Request.InputSt ream.Position = 0;
FileStream fs = File.Open("c:\\ Projects\\Log.t xt", FileMode.Append );
foreach (string key in Request.Headers )
{
string header = key + ": " + Request.Headers[key] + Environment.New Line;
fs.Write(Encodi ng.UTF8.GetByte s(header), 0, header.Length);
}
fs.Write(buffer , 0, buffer.Length);
string end = Environment.New Line + Environment.New Line;
fs.Write(Encodi ng.UTF8.GetByte s(end), 0, end.Length);
fs.Close();
}
<ch****@totalis e.co.ukwrote in message
news:11******** *************@a 75g2000cwd.goog legroups.com...
Hi all,
I want to evaluate the size of the http request sent to my
webservice. How can I accomplish this?
System.Web.Http Context.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