post xml with axios nodejs
const axios = require('axios');
const fs = require('fs');
const xmlData = fs.readFileSync('path/to/your/xml/file.xml', 'utf-8');
const headers = {
'Content-Type': 'application/xml',
// Add any other headers if needed
};
const axiosConfig = {
headers,
};
axios.post('your-api-endpoint-url', xmlData, axiosConfig)
.then(response => {
console.log('Response:', response.data);
})
.catch(error => {
console.error('Error:', error.message);
});