[Feature Request] Save value(s) from response to environment
See original GitHub issueI have several login requests defined. The response of every request contains a token. I would like to save the token to an environment settings for later use by other requests using the token in their authentication header as a bearer token.
It can be done for instance by defining a function that would be executed after a request is done. Its response would be passed to this function containing a simple code:
function (response) {
Environment["localhost"].token = response.token;
}
It would allow to run whatever defined login requests (e.g. with various users) and then test other requests.
I know there is a functionality to create a tag as a value of a property in the environment that would take the value from a specified request, but the point here is the request is not known when the tag is created. By using a tag you can’t have more login requests, send one of them and expect that the token value will be used later by other requests since you have to run just the one specified in the tag.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:5

Top Related StackOverflow Question
it’s a huge missing feature. sad to see this being closed
Chaining request seems to do part of the job but not entierly. If you have 2 different possible resources to authenticate, I didn’t figure out how to put the last result of the last executed request into the variable. It seems you just can put the result of only one request per variable. Am I mistaken ?