Name

RequestType

Synopsis

stringvar 
                      = Request.RequestType

The RequestType property returns a String containing the request type (i.e., GET or POST) of the current request.

Parameters

stringvar

A String variable to receive the request type.

Example

The example writes the RequestType property to the browser:

Sub Page_Load(  )
   Dim stringvar As String
   stringvar = Request.RequestType
   Message.Text = "The request type is: " & stringvar
End Sub

Notes

This property is listed as read/write; however, there really aren’t any situations where it would be useful to change its value. From the read standpoint, this property returns the same information as the read-only HttpMethod property listed earlier in this chapter. If you attempt to change its value, no corresponding change occurs in the value of HttpMethod.

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.