Sideway
output.to from Sideway
Draft for Information Only

Content

Request Object
 Examples
 Source/Reference

Request Object

The Request object is an instance of the System.Web.HttpRequest class. Request object of ASP.NET is related to retrieving data by the server from the client.

Tthe Request property of the Page class can be use to access the HttpRequest instance for the current request. For example, Request["key"] can be used for accessing data from the QueryString, Form, Cookies, or ServerVariables collections.

The methods and properties of the HttpRequest class are exposed through the Request properties of the HttpApplication, HttpContext, Page, and UserControl classes.

Note: Unicode support for HttpRequest class members requires IIS version 6.0 or later.

Examples

Examples of Request Properties
ASP.NET Code Input:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
       <title>Sample Page</title>
       <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
       <script LANGUAGE="VBScript" runat="server" >
           Sub Page_Load()
               Dim xstr As String =""
               Dim xarry() As Object = {"AcceptTypes","AnonymousID","ApplicationPath","AppRelativeCurrentExecutionFilePath","Browser","ClientCertificate","ContentEncoding","ContentLength","ContentType","Cookies","CurrentExecutionFilePath","FilePath","Files","Filter","Form","Headers","HttpChannelBinding","HttpMethod","InputStream","IsAuthenticated","IsLocal","IsSecureConnection","Item[String]","LogonUserIdentity","Params","Path","PathInfo","PhysicalApplicationPath","PhysicalPath","QueryString","RawUrl","RequestType","ServerVariables","TotalBytes","Url","UrlReferrer","UserAgent","UserHostAddress","UserHostName","UserLanguages"}

               xstr =  "Request.AcceptTypes(0): " + Request.AcceptTypes(0) + "<br />"
               xstr = xstr + "Request.AnonymousID: " + Request.AnonymousID + "<br />"
               xstr = xstr + "Request.ApplicationPath: " + Request.ApplicationPath + "<br />"
               xstr = xstr + "Request.AppRelativeCurrentExecutionFilePath: " + Request.AppRelativeCurrentExecutionFilePath + "<br />"
               xstr = xstr + "Request.Browser(0): " + Request.Browser(0) + "<br />"
               xstr = xstr + "Request.ClientCertificate.Issuer: " + Request.ClientCertificate.Issuer + "<br />"
               xstr = xstr + "Request.ContentEncoding.EncodingName: " + Request.ContentEncoding.EncodingName + "<br />"
               xstr = xstr + "Request.ContentLength: " + Request.ContentLength.ToString + "<br />"
               xstr = xstr + "Request.ContentType: " + Request.ContentType + "<br />"
               xstr = xstr + "Request.Cookies.Count: " + Request.Cookies.Count.ToString + "<br />"
               xstr = xstr + "Request.CurrentExecutionFilePath: " + Request.CurrentExecutionFilePath + "<br />"
               xstr = xstr + "Request.FilePath: " + Request.FilePath + "<br />"
               xstr = xstr + "Request.Files.Count: " + Request.Files.Count.ToString + "<br />"
               xstr = xstr + "Request.Filter.Length: " + Request.Filter.Length.ToString + "<br />"
               xstr = xstr + "Request.Form.Count: " + Request.Form.Count.ToString + "<br />"
               xstr = xstr + "Request.Headers: " + Request.Headers.ToString + "<br />"
               xstr = xstr + "Request.HttpChannelBinding.Size: " + Request.HttpChannelBinding.Size.ToString + "<br />"
               xstr = xstr + "Request.HttpMethod: " + Request.HttpMethod + "<br />"
               xstr = xstr + "Request.InputStream: " + Request.InputStream.Length.ToString + "<br />"
               xstr = xstr + "Request.IsAuthenticated: " + Request.IsAuthenticated.ToString + "<br />"
               xstr = xstr + "Request.IsLocal: " + Request.IsLocal.ToString + "<br />"
               xstr = xstr + "Request.IsSecureConnection: " + Request.IsSecureConnection.ToString + "<br />"
               xstr = xstr + "Request.Item(""Url""): " + Request.Item("Url") + "<br />"
               xstr = xstr + "Request.LogonUserIdentity: " + Request.LogonUserIdentity.ToString + "<br />"
               xstr = xstr + "Request.Params: " + Request.Params.ToString + "<br />"
               xstr = xstr + "Request.Path: " + Request.Path + "<br />"
               xstr = xstr + "Request.PathInfo: " + Request.PathInfo + "<br />"
               xstr = xstr + "Request.PhysicalApplicationPath: " + Request.PhysicalApplicationPath + "<br />"
               xstr = xstr + "Request.PhysicalPath: " + Request.PhysicalPath + "<br />"
               xstr = xstr + "Request.QueryString: " + Request.QueryString.ToString + "<br />"
               xstr = xstr + "Request.RawUrl: " + Request.RawUrl + "<br />"
               xstr = xstr + "Request.RequestType: " + Request.RequestType + "<br />"
               xstr = xstr + "Request.ServerVariables: " + Request.ServerVariables.ToString + "<br />"
               xstr = xstr + "Request.TotalBytes: " + Request.TotalBytes.ToString + "<br />"
               xstr = xstr + "Request.Url: " + Request.Url.ToString + "<br />"
               xstr = xstr + "IsNothing(Request.UrlReferrer): " + IsNothing(Request.UrlReferrer).ToString + "<br />"
               xstr = xstr + "Request.UserAgent: " + Request.UserAgent + "<br />"
               xstr = xstr + "Request.UserHostAddress: " + Request.UserHostAddress + "<br />"
               xstr = xstr + "Request.UserHostName: " + Request.UserHostName + "<br />"
               xstr = xstr + "IsNothing(Request.UserLanguages): " + IsNothing(Request.UserLanguages).ToString + "<br />"
             lbl01z.InnerHTML=replace(xstr,"&","&amp;")
           End Sub
       </script>
    </head>
    <body>
       <% Response.Write ("<h1>This is a Sample Page of Request Properties</h1>") %>
           <div id="lbl01z" runat="server"></div>
    </body>
</html>
HTTP Response Output:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
       <title>Sample Page</title>
       <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
       
    </head>
    <body>
       <h1>This is a Sample Page of Request Properties</h1><div id="lbl01z">Request.AcceptTypes(0): image/*<br />Request.AnonymousID: <br />Request.ApplicationPath: /test<br />Request.AppRelativeCurrentExecutionFilePath: ~/test0/test.aspx<br />Request.Browser(0): <br />Request.ClientCertificate.Issuer: <br />Request.ContentEncoding.EncodingName: Unicode (UTF-8)<br />Request.ContentLength: 0<br />Request.ContentType: application / x - www - form - urlencoded<br />Request.Cookies.Count: 0<br />Request.CurrentExecutionFilePath: /test/test0/test.aspx<br />Request.FilePath: /test/test0/test.aspx<br />Request.Files.Count: 0<br />Request.Filter.Length: 0<br />Request.Form.Count: 0<br />Request.Headers: Content-Type=application+%2f+x+-+www+-+form+-+urlencoded&amp;Accept=image%2f*&amp;Host=127&#46;0.0.1&amp;User-Agent=Mozilla%2f4.0+(compatible%3b+MSIE+5.01%3b+Windows+NT+5.0)<br />Request.HttpChannelBinding.Size: 0<br />Request.HttpMethod: GET<br />Request.InputStream: 0<br />Request.IsAuthenticated: False<br />Request.IsLocal: True<br />Request.IsSecureConnection: False<br />Request.Item("Url"): /test/test0/test.aspx<br />Request.LogonUserIdentity: System.Security.Principal.WindowsIdentity<br />Request.Params: ALL_HTTP=HTTP_CONTENT_TYPE%3aapplication+%2f+x+-+www+-+form+-+urlencoded%0d%0aHTTP_ACCEPT%3aimage%2f*%0d%0aHTTP_HOST%3a127&#46;0.0.1%0d%0aHTTP_USER_AGENT%3aMozilla%2f4.0+(compatible%3b+MSIE+5.01%3b+Windows+NT+5.0)%0d%0a&amp;ALL_RAW=Content-Type%3a+application+%2f+x+-+www+-+form+-+urlencoded%0d%0aAccept%3a+image%2f*%0d%0aHost%3a+127&#46;0.0.1%0d%0aUser-Agent%3a+Mozilla%2f4.0+(compatible%3b+MSIE+5.01%3b+Windows+NT+5.0)%0d%0a&amp;APPL_MD_PATH=%2fLM%2fW3SVC%2f3%2fROOT%2ftest&amp;APPL_PHYSICAL_PATH=R%3a%5cwebs%5ctest%5c&amp;AUTH_TYPE=&amp;AUTH_USER=&amp;AUTH_PASSWORD=&amp;LOGON_USER=&amp;REMOTE_USER=&amp;CERT_COOKIE=&amp;CERT_FLAGS=&amp;CERT_ISSUER=&amp;CERT_KEYSIZE=&amp;CERT_SECRETKEYSIZE=&amp;CERT_SERIALNUMBER=&amp;CERT_SERVER_ISSUER=&amp;CERT_SERVER_SUBJECT=&amp;CERT_SUBJECT=&amp;CONTENT_LENGTH=0&amp;CONTENT_TYPE=application+%2f+x+-+www+-+form+-+urlencoded&amp;GATEWAY_INTERFACE=CGI%2f1.1&amp;HTTPS=off&amp;HTTPS_KEYSIZE=&amp;HTTPS_SECRETKEYSIZE=&amp;HTTPS_SERVER_ISSUER=&amp;HTTPS_SERVER_SUBJECT=&amp;INSTANCE_ID=3&amp;INSTANCE_META_PATH=%2fLM%2fW3SVC%2f3&amp;LOCAL_ADDR=127&#46;0.0.1&amp;PATH_INFO=%2ftest%2ftest0%2ftest.aspx&amp;PATH_TRANSLATED=R%3a%5cwebs%5ctest%5ctest0%5ctest.aspx&amp;QUERY_STRING=&amp;REMOTE_ADDR=127&#46;0.0.1&amp;REMOTE_HOST=127&#46;0.0.1&amp;REMOTE_PORT=50990&amp;REQUEST_METHOD=GET&amp;SCRIPT_NAME=%2ftest%2ftest0%2ftest.aspx&amp;SERVER_NAME=127&#46;0.0.1&amp;SERVER_PORT=80&amp;SERVER_PORT_SECURE=0&amp;SERVER_PROTOCOL=HTTP%2f1.1&amp;SERVER_SOFTWARE=Microsoft-IIS%2f8.5&amp;URL=%2ftest%2ftest0%2ftest.aspx&amp;HTTP_CONTENT_TYPE=application+%2f+x+-+www+-+form+-+urlencoded&amp;HTTP_ACCEPT=image%2f*&amp;HTTP_HOST=127&#46;0.0.1&amp;HTTP_USER_AGENT=Mozilla%2f4.0+(compatible%3b+MSIE+5.01%3b+Windows+NT+5.0)<br />Request.Path: /test/test0/test.aspx<br />Request.PathInfo: <br />Request.PhysicalApplicationPath: R:\webs\test\<br />Request.PhysicalPath: R:\webs\test\test0\test.aspx<br />Request.QueryString: <br />Request.RawUrl: /test/test0/test.aspx<br />Request.RequestType: GET<br />Request.ServerVariables: ALL_HTTP=HTTP_CONTENT_TYPE%3aapplication+%2f+x+-+www+-+form+-+urlencoded%0d%0aHTTP_ACCEPT%3aimage%2f*%0d%0aHTTP_HOST%3a127&#46;0.0.1%0d%0aHTTP_USER_AGENT%3aMozilla%2f4.0+(compatible%3b+MSIE+5.01%3b+Windows+NT+5.0)%0d%0a&amp;ALL_RAW=Content-Type%3a+application+%2f+x+-+www+-+form+-+urlencoded%0d%0aAccept%3a+image%2f*%0d%0aHost%3a+127&#46;0.0.1%0d%0aUser-Agent%3a+Mozilla%2f4.0+(compatible%3b+MSIE+5.01%3b+Windows+NT+5.0)%0d%0a&amp;APPL_MD_PATH=%2fLM%2fW3SVC%2f3%2fROOT%2ftest&amp;APPL_PHYSICAL_PATH=R%3a%5cwebs%5ctest%5c&amp;AUTH_TYPE=&amp;AUTH_USER=&amp;AUTH_PASSWORD=&amp;LOGON_USER=&amp;REMOTE_USER=&amp;CERT_COOKIE=&amp;CERT_FLAGS=&amp;CERT_ISSUER=&amp;CERT_KEYSIZE=&amp;CERT_SECRETKEYSIZE=&amp;CERT_SERIALNUMBER=&amp;CERT_SERVER_ISSUER=&amp;CERT_SERVER_SUBJECT=&amp;CERT_SUBJECT=&amp;CONTENT_LENGTH=0&amp;CONTENT_TYPE=application+%2f+x+-+www+-+form+-+urlencoded&amp;GATEWAY_INTERFACE=CGI%2f1.1&amp;HTTPS=off&amp;HTTPS_KEYSIZE=&amp;HTTPS_SECRETKEYSIZE=&amp;HTTPS_SERVER_ISSUER=&amp;HTTPS_SERVER_SUBJECT=&amp;INSTANCE_ID=3&amp;INSTANCE_META_PATH=%2fLM%2fW3SVC%2f3&amp;LOCAL_ADDR=127&#46;0.0.1&amp;PATH_INFO=%2ftest%2ftest0%2ftest.aspx&amp;PATH_TRANSLATED=R%3a%5cwebs%5ctest%5ctest0%5ctest.aspx&amp;QUERY_STRING=&amp;REMOTE_ADDR=127&#46;0.0.1&amp;REMOTE_HOST=127&#46;0.0.1&amp;REMOTE_PORT=50990&amp;REQUEST_METHOD=GET&amp;SCRIPT_NAME=%2ftest%2ftest0%2ftest.aspx&amp;SERVER_NAME=127&#46;0.0.1&amp;SERVER_PORT=80&amp;SERVER_PORT_SECURE=0&amp;SERVER_PROTOCOL=HTTP%2f1.1&amp;SERVER_SOFTWARE=Microsoft-IIS%2f8.5&amp;URL=%2ftest%2ftest0%2ftest.aspx&amp;HTTP_CONTENT_TYPE=application+%2f+x+-+www+-+form+-+urlencoded&amp;HTTP_ACCEPT=image%2f*&amp;HTTP_HOST=127&#46;0.0.1&amp;HTTP_USER_AGENT=Mozilla%2f4.0+(compatible%3b+MSIE+5.01%3b+Windows+NT+5.0)<br />Request.TotalBytes: 0<br />Request.Url: http://127&#46;0.0.1/test/test0/test.aspx<br />IsNothing(Request.UrlReferrer): True<br />Request.UserAgent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)<br />Request.UserHostAddress: 127&#46;0.0.1<br />Request.UserHostName: 127&#46;0.0.1<br />IsNothing(Request.UserLanguages): True<br /></div>
    </body>
</html>
HTML Web Page Embedded Output:

Source/Reference

  • m

©sideway

ID: 201100013 Last Updated: 13/11/2020 Revision: 0 Ref:

close

References

  1. Active Server Pages,  , http://msdn.microsoft.com/en-us/library/aa286483.aspx
  2. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929%28v=vs.90%29.aspx
  3. ASP Best Practices,  , http://technet.microsoft.com/en-us/library/cc939157.aspx
  4. ASP Built-in Objects,  , http://msdn.microsoft.com/en-us/library/ie/ms524716(v=vs.90).aspx
  5. Response Object,  , http://msdn.microsoft.com/en-us/library/ms525405(v=vs.90).aspx
  6. Request Object,  , http://msdn.microsoft.com/en-us/library/ms524948(v=vs.90).aspx
  7. Server Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525541(v=vs.90).aspx
  8. Application Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525360(v=vs.90).aspx
  9. Session Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms524319(8v=vs.90).aspx
  10. ASPError Object,  , http://msdn.microsoft.com/en-us/library/ms524942(v=vs.90).aspx
  11. ObjectContext Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525667(v=vs.90).aspx
  12. Debugging Global.asa Files,  , http://msdn.microsoft.com/en-us/library/aa291249(v=vs.71).aspx
  13. How to: Debug Global.asa files,  , http://msdn.microsoft.com/en-us/library/ms241868(v=vs.80).aspx
  14. Calling COM Components from ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524620(v=VS.90).aspx
  15. IIS ASP Scripting Reference,  , http://msdn.microsoft.com/en-us/library/ms524664(v=vs.90).aspx
  16. ASP Keywords,  , http://msdn.microsoft.com/en-us/library/ms524672(v=vs.90).aspx
  17. Creating Simple ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524741(v=vs.90).aspx
  18. Including Files in ASP Applications,  , http://msdn.microsoft.com/en-us/library/ms524876(v=vs.90).aspx
  19. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929(v=vs.90).aspx
  20. FileSystemObject Object,  , http://msdn.microsoft.com/en-us/library/z9ty6h50(v=vs.84).aspx
  21. http://msdn.microsoft.com/en-us/library/windows/desktop/ms675944(v=vs.85).aspx,  , ADO Object Model
  22. ADO Fundamentals,  , http://msdn.microsoft.com/en-us/library/windows/desktop/ms680928(v=vs.85).aspx
close

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 337

Reference 67

Computer

Hardware 151

Software

Application 198

Digitization 25

Latex 9

Manim 122

Numeric 19

Programming

Web 285

Unicode 494

HTML 65

CSS 59

ASP.NET 194

OS 391

DeskTop 7

Python 23

Knowledge

Mathematics

Formulas 8

Algebra 29

Number Theory 206

Trigonometry 18

Geometry 21

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Physics

Electric 27

Biology 1

Geography 1


Copyright © 2000-2020 Sideway . All rights reserved Disclaimers last modified on 06 September 2019