Name
Request
Synopsis
HttpRequest = Page.Request
Returns
an instance of the
HttpRequest
class that allows us to access data from
the incoming HTTP requests. It’s the equivalent of
the ASP intrinsic Request object. For more information on the
HttpRequest class, see Chapter 16.
Parameters
-
HttpRequest An object of type HttpRequest that contains the data from the incoming HTTP requests.
Example
The following code example uses the ServerVariables collection of the HttpRequest object to display the IP address of the client making the request:
Sub Page_Load( )
Message.Text = "The current request is from: " & _
CStr(Request.ServerVariables.Item("REMOTE_ADDRESS"))
End SubNotes
As with the Application and Cache properties, while you can retrieve a local reference to the HttpRequest instance associated with the request, it is more common to access this instance directly through the Request property, as shown in this example.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access