Hi everyone!
I have a service that checks if a dynamically generated header has a certain value.
For sake of simplicity let’s suppose this header is the concatenation of URL and body. It should be feasible to do so for a single request using variables.
How can I extend this behavior to all the requests of a collection?
Hey @flight-architect-935 Welcome to the Postman Community
If I understand your query correctly, you want to apply the same set of script for each request in a collection, is that correct?
If so, you can add pre-request script for a collection as below to add pm.request.headers.add()
method to add a custom header to each request:
Hope this helps! Let me know if you have further questions
2 Likes
Thank you! That’s indeed what I needed
1 Like