I added some JavaScript in the pre-request script tab for a collection to add some headers but none of them are getting executed.
Here is the text I added:
pm.request.headers.add({key: “Authorization”, value: “Basic xxxxxxxxxx” })
here, xxxx is the key value.
I looked at the console logs and this header is not showing up there, I also added a console.log(“Hello”) that is also not showing up in the logs.
Note that, if you set it at the collection level, if you run the HTTP request individually, you will not trigger the pre-req script at the collection level, you need to run via the collection runner for that you happen.