Is there a way to retrieve the redirected url from a Postman response?

爱⌒轻易说出口 提交于 2020-01-23 22:52:06

问题


I'm trying to submit a form in Postman which then redirects to another url. The redirected url query string contains some information that I want to use in my next call. Is this even possible and if yes, how?

I haven't been able to find anything in Postman docs regarding this.


回答1:


Yes, you can retrieve the redirected URL, extract interested information, and use it in the next request in Postman.

First, to retrieve the redirected URL, the "Automatically follow redirects" option in Postman should be turned off:

Then, you can intercept the redirect response, extract what is interested, and set it as global variable or environment variable:

Finally, this variable can be used in "next request", as query string in GET request, or as part of POST request's body:



来源:https://stackoverflow.com/questions/56763018/is-there-a-way-to-retrieve-the-redirected-url-from-a-postman-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!