dsid cookie code example

Example 1: how to add cookie

To handle cookie in postman there is a button
called cookie to give us a way to add cookie
to certain domain by providing key+value pair
Once added any request sent to the same domain,
can access that cookie. We can also access to
the cookie in test tab.

pm.test('the "abc" cookie has correct value', function () {
    pm.expect(pm.cookies.toObject()).to.have.property('abc', 'AWESOME');
});

pm.test('the "Motto" cookie has correct value', function () {
    pm.expect(pm.cookies.toObject()).to.have.property('Motto', 'Hold your horse');

Example 2: what is cookie

So cookie is a rest request which basically
just like on the websites, used to store
some common information about where the 
request originated. For example while end user
shop online once they view certain items
next time once they go to that website it 
will suggest similar products.

Tags:

Misc Example