OnPreHTTP()
You can implement OnPreHTTP() for finer control of the HTTP headers of the response.
Specifically, you can set properties of the %response object, such as the ContentType property, if that needs to be different from the default that you chose:
set %response.ContentType="text/html"
Then InterSystems IRIS uses those values when writing to the client.
The OnPreHTTP() method is also where you can define redirects, if needed. You can create a normal client-side redirect by setting the Redirect property:
set %response.Redirect="https://someotherurl"
Or, if you want to invoke another CSP page, you can instead set the ServerSideRedirect property, which will cause the CSP Server to invoke the Page() method in the specified class.
set %response.Redirect="GCSP.OtherPage.cls"
Note that a server-side redirect does not change the URL seen in the browser.
OnPostHTTP()
The OnPostHTTP() method is provided as a place to perform any operations you wish to perform after processing of the HTTP request is complete.