How to use the postman-collection.Cookie 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
cookieDef.key; // $ExpectType string | undefined
cookieDef.value; // ExpectType string | undefined
cookieDef.expires; // $ExpectType string | Date | undefined
cookieDef.maxAge; // $ExpectType number | undefined
cookieDef.domain; // $ExpectType string
cookieDef.path; // $ExpectType string
cookieDef.secure; // $ExpectType boolean | undefined
cookieDef.httpOnly; // $ExpectType boolean | undefined
cookieDef.hostOnly; // $ExpectType boolean | undefined
cookieDef.session; // $ExpectType boolean | undefined
cookieDef.extensions; // $ExpectType { key: string; value: string; }[] | undefined

// Cookie Tests

let cookie = new pmCollection.Cookie();
cookie = new pmCollection.Cookie(cookieDef);

cookie.domain; // $ExpectType string
cookie.expires; // $ExpectType Date
cookie.extensions; // $ExpectType { key: string; value: string; }[] | undefined
cookie.hostOnly; // $ExpectType boolean | undefined
cookie.httpOnly; // $ExpectType boolean | undefined
cookie.maxAge; // $ExpectType number | undefined
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
github DefinitelyTyped / DefinitelyTyped / types / postman-collection / postman-collection-tests.ts View on Github external
};
cookieDef.key; // $ExpectType string | undefined
cookieDef.value; // ExpectType string | undefined
cookieDef.expires; // $ExpectType string | Date | undefined
cookieDef.maxAge; // $ExpectType number | undefined
cookieDef.domain; // $ExpectType string
cookieDef.path; // $ExpectType string
cookieDef.secure; // $ExpectType boolean | undefined
cookieDef.httpOnly; // $ExpectType boolean | undefined
cookieDef.hostOnly; // $ExpectType boolean | undefined
cookieDef.session; // $ExpectType boolean | undefined
cookieDef.extensions; // $ExpectType { key: string; value: string; }[] | undefined

// Cookie Tests

let cookie = new pmCollection.Cookie();
cookie = new pmCollection.Cookie(cookieDef);

cookie.domain; // $ExpectType string
cookie.expires; // $ExpectType Date
cookie.extensions; // $ExpectType { key: string; value: string; }[] | undefined
cookie.hostOnly; // $ExpectType boolean | undefined
cookie.httpOnly; // $ExpectType boolean | undefined
cookie.maxAge; // $ExpectType number | undefined
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
github postmanlabs / postman-sandbox / lib / sandbox / cookie-jar.js View on Github external
deserialize = function (cookie) {
        if (!cookie) {
            return;
        }

        return new PostmanCookie({
            name: cookie.key,
            value: cookie.value,
            expires: cookie.expires === 'Infinity' ? null : cookie.expires,
            maxAge: cookie.maxAge,
            domain: cookie.domain,
            path: cookie.path,
            secure: cookie.secure,
            httpOnly: cookie.httpOnly,
            hostOnly: cookie.hostOnly,
            extensions: cookie.extensions
        });
    },
github postmanlabs / postman-runtime / lib / requester / requester.js View on Github external
toPostmanCookie = function (cookie) {
        cookie.toJSON && (cookie = cookie.toJSON());

        return new sdk.Cookie({
            name: cookie.key,
            value: cookie.value,
            expires: cookie.expires === 'Infinity' ? null : cookie.expires,
            maxAge: cookie.maxAge,
            domain: cookie.domain,
            path: cookie.path,
            secure: cookie.secure,
            httpOnly: cookie.httpOnly,
            hostOnly: cookie.hostOnly,
            extensions: cookie.extensions
        });
    },