Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As previously noted, a developer can simply embed a debug statement in the API code but this would affect all requests. So there needs to be a way to safely trigger the debugger. In traditional OpenInsight development, developers could check for unique conditions such as the values in the @USERNAME or @STATION system variables. All HTTP requests, however, will always be handled by the same username and station.

One way to add back the ability to check for special values introduce unique conditions is to put add custom parameters in to the API callrequest. API testing tools like Postman make it very easy to add a custom parameterparameters. We recommend updating the AdditionalValues string from the OECGI4 registry key to include HTTP_DEBUG. Doing so will tell the OECGI to pass through a Request Header request header with the name Debug. You could, of course, create any name you want.

...

Code Block
languagebp
// Engage the debugger if requested.
If HTTP_Services('GetRequestHeaderField', 'Debug') then Debug

This same code could be copied anywhere and adapted as needed (e.g., change the name of the header field or check for a specific field value).