While I can Get instance information proving that the authentication is working correctly when I try and send POST request to start and stop the instance I get the below error message.
There was an error in evaluating the Pre-request Script:TypeError: Cannot read properties of undefined (reading โlengthโ).
The environment settings are the attached, There is a length field which i have tried populating, I have also tried removing it but the error message stays the same
There was an entry in the Pre-request Script of the parent collection.
I changed
var body = "";
if(methodsThatRequireExtraHeaders.indexOf(request.method.toUpperCase()) !== -1) {
body = pm.request.body.raw;
//pm.environment.set("length", body.length);
var content_length_header = "content-length: "+ body.length ;
}
to
var body = "";
if (methodsThatRequireExtraHeaders.indexOf(request.method.toUpperCase()) !== -1) {
if (pm.request.body && pm.request.body.raw) {
body = pm.request.body.raw;
}
var content_length_header = "content-length: " + body.length;
And now the start and stop works correctly.
I am unsure how this worked for other people but with the update it now works for me.