'Postman Request Chaining by Setting Next-Token Header Variable
I have a GET Request that returns a fixed paginated number of results. To process all of the pages, I would need to use the available X-Next-Token.
I have the X-Next-Token set as a an empty variable in the environment.
In Postman's Tests Section, I can see that I can pull the X-Next-Token
Tests
next_token = pm.response.headers.get("X-Next-Token");
console.log(next_token)
postman.setEnvironmentVariable("X-Next-Token", next_token);
console.log(pm.request.headers)
Postman Console
I've tried to this solution
postman.setEnvironmentVariable("X-Next-Token", pm.response.headers.get("X-Next-Token"));
When the X-Next-Token variable is empty it seems to populate initially. But it doesn't change subsequently.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

