473,326 Members | 2,099 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,326 software developers and data experts.

request size?

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

Feb 28 '07 #1
1 1891
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
Mar 8 '07 #2

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

Similar topics

0
by: ThisIsMe | last post by:
I am using this php email form and it seems to work. But I would like for the option for attn$ Webmaster to go to a different email address than the mymail$ Please be Kind to us newbies... can...
2
by: Sean Dotson | last post by:
I have a form that passes variables to an asp file and then uploads a file. For some reason the request.form is not getting the info from the form. It's returning blanks. Any insight would be...
2
by: Laurent Bertin | last post by:
Hi i got a strange problem but it's true i don't make thing like anyone... First Config: + IIS5.0 SP2 (yes i know...) WebSite Security Root : Digest Authentication, NT Authenticated SubFolders...
6
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database...
6
by: Daniel Rimmelzwaan | last post by:
I want to send a biztalk document to an aspx page, and I need to see some sample code, because I just can't make it work. I have a port with transport type HTTP, pointing to my aspx page, something...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
2
by: MDANH2002 | last post by:
Hi From VB.NET I want to simulate the POST request of the following HTML form <html> <title>HTTP Post Testing</title> <body> <form action=http://www.example.com/postdata ...
1
by: campos | last post by:
Hi all, I am trying to use javascript to send an HTTP/post request to a server multiple times continously. But the time used on the 1st and 2nd files are longer than others. My idea is that...
7
by: injia | last post by:
I have my server request working but it will only make the request once. onclick calls the ajax function but only once. when i change entires in the form and hit the button nothing happens Here is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.