473,762 Members | 7,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.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

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

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

Similar topics

0
1826
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 someone modify this and resend it so I can have the form send to 2 different email addresses? Or maybe three if that is possible determined by what attn$ option is used.
2
2458
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 appreciated.... Here is the asp file <HTML> <HEAD> <TITLE>File Upload Results</TITLE>
2
2688
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 : Anonymous Login Anonymous login is set to use a domain user to enable a sql server authenticated connection. Permissions are based on Page/action/user Membership
6
7343
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 agent could not be started to service a request, or was terminated as a result of a database system shutdown or a force command.
6
3146
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 like http://myserver/mypage.aspx. From there it gets blurry, because I just can't figure out how to do the rest. Does anybody have a sample page for me that I can take a look at? Just a simple one that takes whatever biztalk sends and saves it...
6
3812
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 is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
2
6308
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 enctype="multipart/form-data" method="post" name="testform">
1
2264
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 because of the 3-way hand shake, time to be used on transferring the first file shoule be 1 RTT longer than that of others. But the results are different from what I'm thinking of. I captured the packets via Wirshark and found out that at the...
7
1635
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 the code: <html> <head> <script language="javascript" type="text/javascript"> <!-- //Browser Support Code function ajaxFunction(){ var ajaxRequest; // The variable that makes Ajax possible!
0
9554
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.