In my request, I load, via a globals variable, some javascript and do an eval on it so I can call it and set up my tests (rather than trying to include a bunch of requests from other collections and having to maintain all of those requests).
I have my request set up (under settings), in postman, to ignore 302 redirects. I have found that when doing a “pm.sendRequest()” from within the "eval"d code in the pre-request script, that the pm object does not abide by the setting for the request (to ignore redirects) and will continue to accept the 302 and follow it. However, if I am in the request itself (the actual running of the request), then the 302-redirect is ignored correctly.
Does anyone know of any way to modify the pm object itself within the eval’d script to force it to also ignore the 302 redirect? I even tried passing in the pm object into my eval’d script to see if it was different in some way, but that did not work either.