'How do I invoke a postman-defined request within a postman pre-request script?
All examples I've seen of calling a REST API within a Pre-Request script use the http API pm.sendRequest().
I'd much rather 'submit' a request that is defined through the Postman UI. Then, the request details can easily be managed through the Postman UI and shared across multiple Pre-Request scripts.
Is there a Postman API to send/invoke a specific request item in a collection?
Solution 1:[1]
What you're looking for is postman.setNextRequest()
You can check the documentation here: Building request workflows
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Christian Baumann |