Synopsis
This method is used to define the HTTP status of the response. The status
must be provided in its complete form: xxx description, with xxx the 3-digit code of the status.
As the status lies on the very first line of the server's response, Response.Status must be set before
the body of the response is returned (if you use the output buffer, Response.Status must be set before the
very first call of Reponse.Flush).
Example
In the following example, we are going to use Response.Status and the HTTP status to allow or not a client
to access the current page; 192.168.1.1 is the only allowed IP address:
<%
IPAddress = Request.ServerVariables("REMOTE_ADDR")
If IPAddress <> "192.168.1.1" Then
Response.Status = "403 Access Forbidden"
Response.Write("You are not allowed to read this page")
' The access is refused: the actual page must not be returned
Response.End
End If
%>
You can access this page
|
List of all HTTP/1.1 status
printable format
|