472,805 Members | 951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

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 HttpWorkerRequest which has a method called
GetHttpVersion() which returns the exact thing I am
missing. However, I can't see how to get at the
HttpWorkerRequest from a Page or from the HttpApplication.

What am I missing?
Thanks!
Juan
Nov 17 '05 #1
1 2430
Hello Juan,
After some research, I found the property that you need to look at. It is
part of HttpRequest.ServerVariables.
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.com>
| Sender: "Juan Dent" <ju***@dev.com>
| 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: AcNAHDD3hOYTHlkISaumJPMKmwaj9A==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: cpmsftngxa09.phx.gbl
| Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:31552
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.framework.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
| IAuthenticationModule 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.HttpWebRequest rqst =
| >(HttpWebRequest)System.Net.WebRequest.Create
| ("http://www.microsoft.com");
| >rqst.Method = "POST";
| >rqst.ProtocolVersion = HttpVersion.Version10;//sets the
| version to 1.0
| >
| >In some method you can get the WebRequest from ASP.NET
| such as Authenticate
| >of the IAuthenticationModule,
| >
| >The following sample illustrates this:
| >
| >using System;
| >using System.Net;
| >using System.Text;
| >
| >namespace MyAuthenticationModule
| >{
| > public class MyAuthenticationModule :
| IAuthenticationModule
| > {
| > private string _authType = "Basic";
| > public Authorization Authenticate(String
| 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.com>
| >| Sender: "Juan Dent" <ju***@dev.com>
| >| 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+S9YAxvzvaopQ==
| >| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| >| Newsgroups: microsoft.public.dotnet.framework.aspnet
| >| Path: cpmsftngxa09.phx.gbl
| >| Xref: cpmsftngxa09.phx.gbl
| microsoft.public.dotnet.framework.aspnet:31453
| >| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| >| X-Tomcat-NG: microsoft.public.dotnet.framework.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 HttpWorkerRequest which has a method called
| >| GetHttpVersion() which returns the exact thing I am
| >| missing. However, I can't see how to get at the
| >| HttpWorkerRequest 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
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...
0
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"...
6
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 =...
2
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...
3
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...
3
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,...
8
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? --...
51
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
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...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.