Having an env var point to an attribute of either of multiple responses #3592
Replies: 2 comments
-
Because Insomnia uses Nunjucks templates, you can do conditionals as part of a template. Note, the tag for the This somewhat works though. If If |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
My problem is that I'm trying to test a paging endpoint where paging is done using a continuation token (as opposed to using skip and limit params). In this scenario, requesting the first page not only returns the results, but also a token pointing to the next page. The second page will be requested using the token retrieved from the previous response.
Today, if I want to iterate through N pages, I'll have to create N distinct requests, each retrieving the token from its predecessor.
The solution I'm suggesting, is to have an env var point to response X's attribute and to fallback to response Y's attribute if X hasn't ran yet (being the second/third/... page and Y being the first page).
An alternative would be to enable running custom scripts.
Beta Was this translation helpful? Give feedback.
All reactions