- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Add Cookies in Postman?
We can add cookies in Postman. To add a cookie, the below steps need to be followed −
Step1 − Navigate to the Params tab below the address bar and then click on Cookies.
Step2 − The MANAGE COOKIES window shall open. It lists down all the current cookies. To add a cookie, click on the Add Cookie button. An edit box with pre-populated values of the cookie are displayed. We can update the value and Save it.
Step3 − Send the request to the server.
Step4 − After the request has been successfully completed, the Cookies tab in the Response will show the newly added cookie – Cookie_Postman.
We can also add a cookie programmatically and not from the GUI. For that, we have to first create a Cookie jar object with the help of the pm.cookies.jar method.
const cnt = pm.cookies.jar()
Then to create a cookie we have to use the function - .set. This function takes the URL, cookie name and value as parameters.
const cnt = pm.cookies.jar(); cnt.set(URL, cookie name, cookie value, callback(error, cookie))
- How to Manage Cookies in Postman?
- Executing Tests on Cookies in Postman
- How to set cookies in ReactJS?
- How to manage cookies in WebdriverIO?
- How to Monitor Collections in Postman?
- How to use Sessions in Postman?
- How to Import Collection in Postman?
- How to parameterize requests in Postman?
- How to create sessions in Postman?
- How cookies work in JSP?
- How to read cookies with JSP?