In Postman, I can set a environment-variable by HTTP response ,JSON response by adding these codes to Tests.
const body = JSON.parse(responseBody);
if (body.code) {
pm.environment.set("code", body.code)
}
Can I do like this in REST-CLIENT?
@erfanium you could set it into a named variable
@code = {{requestName.response.body.$.code}}
I was looking for the same ability,
requests variables seems to exists, but only with a file scope. Would be great to have "global requests variables" that overrides environment variables based on a response.
Most helpful comment
I was looking for the same ability,
requests variables seems to exists, but only with a file scope. Would be great to have "global requests variables" that overrides environment variables based on a response.