How can I access the redirected url in postman?

I have a big problem. I’m sending a request on postman. Then, the url is redirected. I can see the redirected url in Postman console. But I can’t access it from the test tab. I need to access the redirected url because the token is generated here. I can do the same operation using the regular expression extractor in JMeter. But I can’t do it in Postman. How can I do this in postman? Can you help me?

1 Like

Hi @ozaneseriu,

Welcome to the community!

You can turn off the “Automatically follow redirects” setting in the Request settings.

You can also change this in your global settings if you want to set it for every request.

Then, on the response, you can get the Location header with pm.response.headers.get('location').

Hope this helps.

Best,

Kevin

3 Likes

Hi @kevin.swiber ,

Can we apply above setting change through Pre-request script?