473,788 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to get the HTTP version

Hi,

The Request.SaveAs method stores in a file the complete
HTTP request including the HttpVersion. However when I try
to reproduce in memory the same thing, I cannot find
the "HTTP/1.1" anywhere. I looked around and found a class
called HttpWorkerReque st which has a method called
GetHttpVersion( ) which returns the exact thing I am
missing. However, I can't see how to get at the
HttpWorkerReque st from a Page or from the HttpApplication .

What am I missing?
Thanks!
Juan
Nov 17 '05 #1
1 2491
Hello Juan,
After some research, I found the property that you need to look at. It is
part of HttpRequest.Ser verVariables.
From that collection, look at SERVER_PROTOCOL property. This will give you
the HTTP version.
If you turn trace on the aspx page, you will see this property part of the
Server Variables.

Please let me know if you have more questions on this.

Thanks,
Bassel Tabbara
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Juan Dent" <ju***@dev.co m>
| Sender: "Juan Dent" <ju***@dev.co m>
| References: <36************ *************** *@phx.gbl>
<Hl************ **@cpmsftngxa09 .phx.gbl>
| Subject: RE: Need to get the HTTP version
| Date: Tue, 1 Jul 2003 15:00:32 -0700
| Lines: 122
| Message-ID: <39************ *************** *@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcNAHDD3hOYTHlk ISaumJPMKmwaj9A ==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Path: cpmsftngxa09.ph x.gbl
| Xref: cpmsftngxa09.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:3155 2
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Thanks for your answer.
| The doubt still remains though, you say:
|
| >You can't get the WebRequest from the Page Class, but you
| >can get the Request object which doesn't have the
| >property that you need.
| So what good is it to me to get the Request object, since
| it does not have a reference to the WebRequest?
| Do I need to add a class implementing the
| IAuthentication Module interface just so I can access
| WebRequest? Seems a lot of work to access something that
| should be easily accessible.
|
| Am I reading you incorrectly?
| Thanks again,
| Juan
|
|
| >-----Original Message-----
| >Hello Juan,
| >You have to use HttpWebRequest. ProtocolVersion Property.
| This property gets
| >or sets the version of HTTP to use for the request.
| >The following sample use the HttpWebRequest and the
| version of HTTP:
| >
| >System.Net.Htt pWebRequest rqst =
| >(HttpWebReques t)System.Net.We bRequest.Create
| ("http://www.microsoft.c om");
| >rqst.Method = "POST";
| >rqst.ProtocolV ersion = HttpVersion.Ver sion10;//sets the
| version to 1.0
| >
| >In some method you can get the WebRequest from ASP.NET
| such as Authenticate
| >of the IAuthentication Module,
| >
| >The following sample illustrates this:
| >
| >using System;
| >using System.Net;
| >using System.Text;
| >
| >namespace MyAuthenticatio nModule
| >{
| > public class MyAuthenticatio nModule :
| IAuthentication Module
| > {
| > private string _authType = "Basic";
| > public Authorization Authenticate(St ring
| challenge, WebRequest
| >request, ICredentials credentials)
| > {
| > HttpWebRequest httpWebRequest = request as
| HttpWebRequest;
| > //...
| > }
| > }
| >}
| >
| >You can't get the WebRequest from the Page Class, but you
| can get the
| >Request object which doesn't have the property that
| >you need.
| >
| >Does this answer your question?
| >
| >
| >
| >Thanks,
| >Bassel Tabbara
| >Microsoft, ASP.NET
| >
| >This posting is provided "AS IS", with no warranties, and
| confers no rights.
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Juan Dent" <ju***@dev.co m>
| >| Sender: "Juan Dent" <ju***@dev.co m>
| >| Subject: Need to get the HTTP version
| >| Date: Tue, 1 Jul 2003 09:59:29 -0700
| >| Lines: 14
| >| Message-ID: <36************ *************** *@phx.gbl>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| Thread-Index: AcM/8iLS2I/EFPTaT+S9YAxvzv aopQ==
| >| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| >| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| >| Path: cpmsftngxa09.ph x.gbl
| >| Xref: cpmsftngxa09.ph x.gbl
| microsoft.publi c.dotnet.framew ork.aspnet:3145 3
| >| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| >| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| >|
| >| Hi,
| >|
| >| The Request.SaveAs method stores in a file the complete
| >| HTTP request including the HttpVersion. However when I
| try
| >| to reproduce in memory the same thing, I cannot find
| >| the "HTTP/1.1" anywhere. I looked around and found a
| class
| >| called HttpWorkerReque st which has a method called
| >| GetHttpVersion( ) which returns the exact thing I am
| >| missing. However, I can't see how to get at the
| >| HttpWorkerReque st from a Page or from the
| HttpApplication .
| >|
| >| What am I missing?
| >| Thanks!
| >| Juan
| >|
| >
| >
| >
| >
| >.
| >
|
Nov 17 '05 #2

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

Similar topics

1
6092
by: bin_P19 P | last post by:
the code i have got is as follows and now im stuck <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Shopping Cart</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="StyleSheet" href="css/style.css" type="text/css">
0
1102
by: comic_rage | last post by:
Hi, I need to use C# to print the xml schema root <?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://www.ciber.com/myfile" xmlns="http://www.ciber.com/myfile" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
6
4964
by: seansan | last post by:
Hi, Does anyone know how to read the full access version number in visual basic? I need to know if the current program instance is SR-1 or SP-3, etc... I currently use: DB_DAO = DBEngine.Version DB_JET = CurrentDb().Version DB_VERSION = Application.SysCmd(acSysCmdAccessVer)
2
1840
by: M Skabialka | last post by:
I installed Visual Studio Beta 2005 but setting up the SQL server was so complex I uninstalled it and put Visual Studio 2003 Academic on. I am totally new to Visual Studio and trying to teach myself from books and online classes. I tried to follow instructions to creating a new ASP.NET Web Application. The default location for this is http://localhost/WebApplication1 I hit OK then get this message: The Web server reported the...
3
4414
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here really understand how this could be an issue. The assemblies that the system is complaining about are ones that we build here and we're not changing version numbers on anything. The errors come and go with no apparent rhyme or reason. We do not...
3
1229
by: batman | last post by:
we have a group of developers which have created and asked us (DBAs) to create many objects in the databases including tables / stored procedures / functions / etc. since our company is growing, however we have an increasing amount of objects that have either been abandoned or have several versions. in an effort to clean of the huge amount of clutter and anytime that something simple like a stored proc needs to change, it is almost...
8
3022
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
51
6525
by: Steven Spits | last post by:
Hi, Plannig to buy Vista, but not sure what version to get. I do VS.NET development, mostly ASP.NET. Can IIS be installed on Vista home premium? Or do I need business or ultimate? Steven
1
7113
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that someone who bothers to read all of it have some pointers. Note, I have posted the stack trace and the code exhibiting the problem further down so if you want to start by reading that, search for +++ Also note that I am unable to reproduce...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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
10177
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
10118
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
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
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();...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
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
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.