I get postman exports from students which I use to check their work. The authorisation of those requests now often contain hardcoded jwt tokens that are invalid by the time I get to checking them and I have to change every individual request with a global variable.
I do instruct my students to use variables, but there’s always a couple who just don’t, but that’s a whole different issue.
Right now I’m using a regex find and replace to remove the Request authorization header in the json export file (which than defaults to ‘inherit from parent’). This sort of works, but isn’t ideal.
Do any of you know if postman offers an easier solution for this?
You can do it though the API.
Create a get request to
https://api.getpostman.com/collections/' + collection_id
, and then in the Test tab where you usually run scripts from, you can use something like this:This probably isn’t doing 100% exactly what you want, but it’s probably close enough that you get the idea, and can modify it yourself.
Then just execute the dummy request
I can’t get it to works as of yet, but this looks great. I’ll give it another try tomorrow.