Initializing Request Handlers
To have initialization code executed before the request and response objects have been initialized
-
Add code to the constructor of your request handler.
Use the constructor for initialization that cannot fail because there is no supported way of returning an error from the constructor of a request handler.
To have initialization code executed before the request object has been initialized and after the response object has been initialized
-
Override CRequestHandlerT::CheckValidRequest in your request handler.
You can use the server context and response object, but do not use the request object. If the initialization code that you add to CheckValidRequest fails, you can return an HTTP status code.
To have initialization code executed after the request and response objects have been initialized
-
Override CRequestHandlerT::ValidateAndExchange in your request handler and add your code there.
You can use any member of CRequestHandlerT at this point and can return an appropriate HTTP status code.
To uninitialize your request handler
-
Override CRequestHandlerT::Uninitialize in your request handler and add your code there.
–or–
-
Add code to your request handler's destructor.