I would try something like this:
const xmlBody = `<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>John Doe</author>
<title>Postman Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2019-10-01</publish_date>
<description>An in-depth look at creating APIs
with Postman.</description>
</book>
</catalog>`;
const options = {
'method': 'POST',
'url': 'httpbin.org/post',
'header': {
'Content-Type': 'application/xml'
},
body: xmlBody
}
pm.sendRequest(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Does this help?