My question:
Is it possible to access request-header after the request is hit?
My pre-request script looks like :
var Cookie = null
pm.sendRequest("http://www.test.com/anuj", function (err, response, options) {
//console.log(pm.cookies);
console.log(request)
Cookie = options.cookies.members[0].value;
//console.log(options.cookies.members[0].value);
});
pm.globals.set("Cookie", Cookie);
pm.environment.set("Cookie", Cookie);
pm.request.headers.add({key: "Cookie", value: Cookie});
So basically I want to capture the auto-generated(auto-injected) Request-Header Cookie from the pre-request script and use it in the actual request
I’ve already tried:
- options.cookies.member
- request.headers
- pm.cookies