Is it possible to call another request in a request using Postman?
I have a collection named A
Inside A I have a POST request named Login and a GET request named Profile
Profile is dependent on Login so in Profile Pre-Request Script will need to call Login
But I can't seem to find a way to call Login
From what I can gathered so far is using
pm.sendRequest({
url: "api/Login",
method: 'POST',
header: { "Content-Type": "application/json"},
body: {
mode: 'raw',
contentType: 'application/json',
raw: JSON.stringify({
username: "username",
password: "password"
})
}
}
But for me it is not user friendly.
Cause that what if I change one of the body data in Login but forgot to edit it in the Pre-Request Script in Profile.
Any suggestions and help are highly apparated. Thanks