Hi @singhsivcan,
Is it possible to add Variable in the Pre-request script as well?
I want to add a variable for the URL parameter in the below pre-request script.
(Ex. http://dummy.restapiexample.com/api/v1/create)
pm.sendRequest({
url: “{{want to add variabl here}}/api/v1/create”,
method: ‘POST’,
header: ‘Content-Type:application/json’,
body: {
mode: ‘raw’,
raw: JSON.stringify({
“username”: “abc”,
“password”:"***"
})
}
},
function (err, response) {
if (response){
pm.environment.set(“value”, response.json().object.object);
}
});
Thanks for your time.