# How can I access the redirected url in postman?

**URL:** <https://community.postman.com/t/how-can-i-access-the-redirected-url-in-postman/14298>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [July 20, 2020, 11:08am UTC](https://community.postman.com/t/how-can-i-access-the-redirected-url-in-postman/14298 "2020-07-20T11:08:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozaneseriu](https://avatars.discourse-cdn.com/v4/letter/o/8edcca/32.png) [@ozaneseriu](https://community.postman.com/u/ozaneseriu)\
**Post date:** [July 20, 2020, 11:08am UTC](https://community.postman.com/t/how-can-i-access-the-redirected-url-in-postman/14298/1 "2020-07-20T11:08:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [July 21, 2020, 12:14am UTC](https://community.postman.com/t/how-can-i-access-the-redirected-url-in-postman/14298/2 "2020-07-21T00:14:10Z")

</div>

Hi @ozaneseriu,

Welcome to the community!

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

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/6/d/6d447f2a906b1257ac91f7ca8b39d682328b4422.png)

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

---

<div class="post-metadata">

**Author:** ![flight-cosmonaut-884](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@flight-cosmonaut-884](https://community.postman.com/u/flight-cosmonaut-884)\
**Post date:** [December 11, 2023, 2:24pm UTC](https://community.postman.com/t/how-can-i-access-the-redirected-url-in-postman/14298/3 "2023-12-11T14:24:46Z")

</div>

Hi @kevin.swiber ,

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