// The opts for the server, also includes the data to be written to file
let opts = {
requestName: request.name || request.url,
fileExtension: ājsonā,
mode: āappendFileā, // Change this to any function of the fs library of node to use it.
uniqueIdentifier: false,
responseData: pm.response.text()
};
pm.sendRequest({
url: āhttp://localhost:3000/writeā,
method: āPOSTā,
header: āContent-Type:application/jsonā,
body: {
mode: ārawā,
raw: pm.response.text()
}
}, function (err, res) {
console.log(res);
});
I am using the above snippet , but the file has only response of first request and i am able to see āInternal Server errorā -500 in all the iterations after POST operation
TypeError [ERR_INVALID_ARG_TYPE]: The ādataā argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
at Object.writeFile (node:fs:2108:5)
The saved file under Responses folder has only response of first request