How to use the postman-collection.CookieList function in postman-collection

To help you get started, we’ve selected a few postman-collection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / postman-collection / postman-collection-tests.ts View on Github external
cookie.path; // $ExpectType string
cookie.secure; // $ExpectType boolean | undefined
cookie.session; // $ExpectType boolean | undefined
cookie.value; // $ExpectType string | undefined

cookie.update(cookieDef); // $ExpectType void

cookie.valueOf(); // $ExpectType string

pmCollection.Cookie.isCookie({}); // $ExpectType boolean
pmCollection.Cookie.parse("string"); // $ExpectType CookieDefinition
pmCollection.Cookie.splitParam("string"); // $ExpectType { key: string; value: string | boolean; }

// CookieList Tests

const cookieList = new pmCollection.CookieList(null, [cookie]);

pmCollection.CookieList.isCookieList(cookieList); // $ExpectType boolean

// DescriptionDefinition Tests

const descDef: pmCollection.DescriptionDefinition = {
    content: "string",
    type: "string"
};
descDef.content; // $ExpectType string
descDef.type; // $ExpectType string | undefined

// Description Tests

let desc = new pmCollection.Description();
desc = new pmCollection.Description("string");
github postmanlabs / postman-sandbox / lib / sandbox / cookie-jar.js View on Github external
this.jar.getCookies(url.toString(true), options, function (err, cookies) {
        if (err) {
            return callbackHandler(callback, err);
        }

        callbackHandler(callback, null, new PostmanCookieList(null, cookies && cookies.map(deserialize)));
    });
};
github postmanlabs / postman-runtime / lib / requester / requester.js View on Github external
cookieJar.getCookies(requestOptions.url, function (err, cookiesFromJar) {
                        if (err) {
                            return done();
                        }

                        cookies = _.transform(cookiesFromJar, function (acc, cookie) {
                            acc.push(toPostmanCookie(cookie));
                        }, []);

                        cookies = new sdk.CookieList(null, cookies);

                        done();
                    });
                }
github postmanlabs / postman-runtime / lib / requester / requester.js View on Github external
cookieJar.getCookies(requestOptions.url, function (err, cookiesFromJar) {
                        if (err) {
                            return done();
                        }

                        cookies = _.transform(cookiesFromJar, function (acc, cookie) {
                            acc.push(toPostmanCookie(cookie));
                        }, []);

                        cookies = new sdk.CookieList(null, cookies);

                        done();
                    });
                }
                else {
                    cookies = new sdk.CookieList(null, []);
                    done();
                }
            };