I have a authorization token(Bearer Token) Used in Sending API Requests there the request is getting sent and the response also been received but the same authorization token is giving me Unauthorized Response when used in Test Script. Please Help on this
pm.sendRequest({
url: 'https://myappurl.com/api/BudgetItem/Get?budgetId=217=&id=382',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer my_working_token',
},
body: {
mode: 'none',
}
}, function(err, response) {
if (err) {
console.error("Error",err);
return;
}
console.log("Response",response);
pm.test("Response status code is 201", function () {
pm.response.to.have.status(201);
});
});
Tell me if Iām missing something here or any setting to be enabled.