ASP Request Object
Discover the ASP Request object, which exposes everything the browser sent — posted form fields, URL parameters, and server or client environment details.
What Is the Request Object?
The Request object represents the incoming HTTP request from the visitor's browser. It is the mirror image of Response: where Response sends things out, Request lets you read everything that came in, organized into a handful of collections you access by name.
Request.Form
Example: Reading a posted field
<%
Dim comment
comment = Request.Form("comment")
If comment <> "" Then
Response.Write("You said: " & comment)
End If
%>Request.QueryString
Example: Reading a URL parameter
<%
Dim category
category = Request.QueryString("category")
Response.Write("Browsing category: " & category)
%>
<!-- Visiting page.asp?category=shoes prints: Browsing category: shoes -->Request.ServerVariables
Beyond form fields and URL parameters, Request.ServerVariables gives you access to details about the server and the client that sent the request — things like the visitor's IP address, their browser string, and which HTTP method was used, none of which come from a form at all.
Example: Reading environment details
<%
Response.Write("Your IP address: " & Request.ServerVariables("REMOTE_ADDR") & "<br>")
Response.Write("Your browser: " & Request.ServerVariables("HTTP_USER_AGENT") & "<br>")
Response.Write("This site is running on: " & Request.ServerVariables("SERVER_NAME"))
%>Exercise: ASP Response and Request
What does Response.Write do on an ASP page?