Рет қаралды 22,526
You can use pre-request scripts in Postman to execute JavaScript before a request runs. By including code in the Pre-request Script tab for a request, collection, or folder, you can carry out pre-processing such as setting variable values, parameters, headers, and body data.
Docs: learning.postm...
Public Workspace: www.postman.co...
For an example of a collection making use of pre-request scripts, check out Twitter’s public workspace in the link above. They use pre-request scripts at the collection level to handle authentication.
Blog: / how-to-automate-oauth2...
For an advanced and practical use case using pre-request scripts, check out this blog post by Allen Helton on refreshing OAuth 2.0 tokens.
Presenter: Sean Keegan, Developer Advocate