Dynamic variables

I am currently using the older Version 5.3.2, because of its nature(No auto-generated/default header) So is there a way to disable the default header in the newer version?

In the version, I am using, How to generate a random value(alphanumeric) and use it?

pre-request script:

pm.environment.set("regSessionID", getRandomValue());

function getRandomValue() {
    const regSessionID = "{{$randomPassword}}";
    console.log(pm.environment.get("regSessionID"));
    return regSessionID;
}

Env variable as:

regSessionID: {{$randomPassword}}

Hey @apalani2

Welcome to the Postman community! :rocket:

Which auto Headers are you referring too, in the newer version. You have the ability to disable all of them.

I’d be surprised if that pm.* API syntax or the dynamic variables even work in that version.

Visual for both old and new version headers.

pm.* API syntax for dynamic is supported in 5.x.x version onward?

Ah right I knew that it was introduced back in V5 but wasn’t sure how far back. The random faker dynamic variables won’t work in V5 thought right? You might have access to $randomInt, $timestamp, $timestamp but not the others in V5

If you go to settings in the top right of the app. You can disable those other Headers (cache-control and postman token) The Content-Type header can be removed if you’re not sending a JSON body.