How do I remove the curly braces in the JSON response body
example response :
{
“id”: “12345”,
“store”: “walmart”,
“location”: “newyork”
}
How to store the above json into a variable by removing the curly braces in tests tab?
If you remove the curly brackets, then this will no longer be a valid JSON object.
If you want this as a single variable, you would keep it as it currently looks (with the curly brackets) and store this by using JSON.stringify() and then when you want to retrieve it, you would JSON.parse().
In order to give you a better response, we need to know a bit more about the use case. What are you going to do with this? I’m guessing you need to use part of it, or all of it in a subsequent request?