Last active
August 29, 2015 14:21
-
-
Save mittsh/c8790ebb0ee36d7ccdb0 to your computer and use it in GitHub Desktop.
Get a response value and increment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function evaluate(context){ | |
// get response body | |
var responseBody = context.getCurrentRequest().getLastExchange().responseBody; | |
// parse JSON | |
var jsonDict = JSON.parse(responseBody); | |
// access the value we need | |
var value = jsonDict.id; // e.g. access the "id" field | |
// parse int and increment | |
return parseInt(value) + 1; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment