Get and store the value of a cookie using Postman [closed]

末鹿安然 提交于 2020-01-03 10:09:33

问题


I need to get the value of a cookie, that is only created when I send a request in postman.

I have tried everything but I don't know how to achieve this. I also need to store that value to use in further requests for my project.

cookie name: JSESSIONID value:09840****************00C44


回答1:


You could use the pm.environment.set('my_cookie', pm.cookies.get('JSESSIONID')) function in the Tests tab and store it as an environment variable.

This can then be used in the next/any Request Body or Request Header etc by referencing it using the {{my_cookie}} syntax.

A very similar issue can be found here.



来源:https://stackoverflow.com/questions/49259402/get-and-store-the-value-of-a-cookie-using-postman

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