I am running API execution using Scenario Outline and csv and want to edit header in the below format where i need to change the requestorid each and every time for the execution. If the headers uses below format and saved in .js and tried saving it in .json file:
"ID-HEADERS" :"{ 'requestorId': '1111', 'authMethod': 'basic'}"
And used below lines to edit the header which is not working:
function() {
var fun = karate.read(headersFilePath + 'headers.js');
var res = fun();
res['ID-HEADERS.requestorId'] = requestorId;
return res;
}