The RedirectRequest method can be used within an
OnCommand event handler to redirect the client to a new
location for the resource that it has requested. This redirection can
be permanent or temporary, depending on whether the server expects the
client to continue to use the original URL when requesting the
resource.
If httpRedirectTemporary is specified, the actual status
code that is returned to the client depends on the version of the
protocol that is being used. If the client has issued the request
using HTTP 1.0 then the server will return a 302 code to the client.
If the client used HTTP 1.1, the server will return a 307 code to the
client that indicates it should use the same command verb (GET, POST,
etc.) when requesting the resource at the new location.
If httpRedirectOther is specified, the status code that is
returned to the client depends on which version of the protocol is
being used. For clients who are using HTTP 1.0, the server will return
a 302 code to the client just as with httpRedirectTemporary. If the client is using HTTP 1.1, the server will return a 303
code to the client that indicates it should always use the GET command
to request the new resource, regardless if a different command was
originally used (POST, PUT, etc.)
This method provides a simplified interface for sending a redirection
status code that also implicitly sets the Location response header to
the value of the Location parameter. If the server application
needs to send alternate redirection codes such as 305 (Use Proxy) then
it should use SetHeader method to set the value of the Location
response header, followed by the SendReponse method to send the
redirection status code.