Testing the response code of a request

This sample code is an event hook that looks for a specific request and captures the response code of that request. In this sample, we are capturing the response of a specific REST API query, and checking to make sure it did not return a 500 Server Error.