Time to upgrade! You only have until October 31, 2019 to move to Dynatrace, our all-in-one software intelligence platform. For details, see the Synthetic Upgrade Center and Dynatrace Synthetic documentation.

Dynamic POST data

This sample code demonstrates how to dynamically set the POST data for an HTTP action.

In the example, we have already gathered the dynamic session ID, most likely from a JSON response. The session ID is stored in a variable called msid. We create the full POST body here and store it in pd. We then set the POST body by referencing the correct step, action, or HTTP request.

// Create the POST body and store in 'pd'
var pd = "saffasdfad" + msid + "dsfasdfads";
// Set the POST body in the appropriate HTTP action
script.steps[1].actions[1].requestList[0].body = window.btoa(pd);