Skip to main content

Shared Data Server - Set

This Eggplant Performance Test Controller REST method creates or modifies the value associated with the specified key in the Shared Data Server.

note

For this method to work, Shared Data Server must be running on the same machine as the Test Controller REST server. This is usually accomplished by enabling the Start the Shared Data Server at the beginning of the test option on the Test View > Shared Data Server tab in Studio.

URL

/test_controller/api/1.0/shared_data_server/set

HTTP Method

POST: Sets the value associated with the specified key in the Shared Data Server

POST Data Parameters

ParameterTypeDescription
keyStringThe key of a shared variable in Shared Data Server. This can be a new key or an existing key.
valueString or integerThe value to store in the Shared Data Server. If the value is not an integer, make sure to enclose it in quotes in the JSON body.
warning

The specified key must relate to a shared variable in Shared Data Server. Shared lists are currently not accessible via this API.

Response Parameters

ParameterTypeDescription
<key>String or integerThe updated value of the shared variable associated with the specified key in Shared Data Server.

Example Request

http://localhost:5001/test_controller/api/1.0/shared_data_server/set
POST Data
{
"key": "my_key",
"value": "my_value"
}

Example Response

{
"my_key": "my_value"
}