I have this Pre-request Script:
pm.request.headers.remove("Authorization");
pm.request.removeHeader("Authorization");
But my request still comes with an Authorization header. I'm pretty sure I'm missing something stupid here. Any ideas?
I have this Pre-request Script:
pm.request.headers.remove("Authorization");
pm.request.removeHeader("Authorization");
But my request still comes with an Authorization header. I'm pretty sure I'm missing something stupid here. Any ideas?
As @mikee suggested I ended up making a collection wise pre-request script to handle the
Authorizationheader. Unfortunately it looks like most of the headers set up by Postman itself are created after thePre-request Scripts ran.This is the script I ended up using:
I use an array to keep track of which endpoints need to have the header set and a variable to store, in my case, the JWT.