Setting headers for entire collection/folder

Maurice Wijnia
Thu, 18 Jan 2018 10:02:47 +0000
Help Hub

Hello everyone!

So I’ve been trying to use Postman/Newman for some automated API tests and I’m running into some issues.

I’ve got a collection of around 100 requests that’s expected to grow even further. In order to authorize I need to set an Authorization header, which is easy to do for an entire collection. But this specific API also expects another header for an API key. I’ve been looking through the internet and through postman but I can’t find a way to set this header for every request, except for putting the header manually in every request, which seems like a lot of work for such a simple task. Is there a way to set a header in the pre-request scripts of a collection/folder or something else that accomplishes the same goal?

45 posts - 27 participants