Well, there is a separate method defined url, so that’s a bit weird to make it immutable.
Also, in console I see that pm.request.body is updated after script, but on backend I receive original request
I have the same issue. I want to remove a repeating property in my JSON input and update the body but what is sent is the original one.
Here is my pre-request script:
var body = pm.request.body.toString();
pm.request.body.update({
mode: "raw",
raw: body.replace(/"id":"[^"]*",/g, '')
});
// Print the correct output, with all "id" property removed.
// But what is actually sent is the original, unmodified output.
console.log(pm.request.body.raw);
This is quite frustrating
EDIT: to be clear I followed what the actual implementation seems to require (see here)
EDIT2: I’m also following this issue on github, but it seems to be going nowhere as of now…