Synthetic Classic has reached end of support and is no longer available. Existing Synthetic Classic customers have been upgraded to the all-in-one Dynatrace software intelligence platform.

Capture response data using an event hook

This sample code is an event hook that looks for a specific request and captures the body of the response for that request. In this sample, we are capturing the response of a specific query, and putting that response in the variable body. Any parsing or decision making can then be done against this variable.

var getUrl = new AddEventHookCommand({
"eventType": "replyReceived",
"name": "directNavigate",
"handler":"if(response.getRequest().getUrl().indexOf('') != -1){body = response.content;}"