I have the following code in my collection’s pre-request script:
utils = {
test: function (a, b) {
console.log("asd1")
pm.sendRequest({ url: 'http://localhost:8082/api/health', method: 'GET' }, (error, response) => {
console.log("returned")
if (error) {
console.log(error);
} else {
console.log(response);
}
});
console.log("asd2")
}
}
And in the pre-request script of a single request I have:
utils.test("a", "b");
When I execute the single request, I get the log messages “asd1” and “asd2” but never “returned”
I verified that the API server was running by using curl locally