If response of below request is in xmlXML format,
pm.sendRequest({
url: myUrl,
method: 'GET',
header: {
'content-type': 'application/json'
}
}, function (err, res) {
console.log(res)
});
I am trying to convert response using below var jsonObject = xml2Json(res); it code
var jsonObject = xml2Json(res);
It is giving error saying JSONError | Unexpected token u in JSON at position 0
JSONError | Unexpected token u in JSON at position 0
When I used that same function with testscript , It is converting xmlXML to hsonObject var jsonObject = xml2Json(responseBody);
var jsonObject = xml2Json(responseBody);