I’ve tried searching forums here and other places, i can’t seem to find anyone having a similar issue.
request.data=[STRING]
In one context is not updating the payload as expected.
I use this basic structure fairly regularly in relation to hmac generation and variable usage.
var payload= (request.data.length >0)?request.data:"";
payload= payload.replace("{{USERNAME}},pm.variqbles.get(USERNAME));
request.data = payload;
This generally works. I mean it always works in the context of the hmac generation i reference.
However im trying to do the same in a different context, printing payload to the logs i can confirm the string is being updated the way i want but the request.date = payload doesn’t set the body. It just uses what the default was.
Any idea why this would be?
What im trying to achieve is if one variable is one value other fields will be removed from the body. This replace structured seemed like the obvious way to do that but I can’t even force this simplified structure to work.
Any help understanding this will be appreciated. I suspect there’s a gap in my understanding of request.data