I need to make request to SOAP endpoint using axios
in my React
application. Hence I need to pass xml data in request and receive xml data in response.
I have used the axios post with json data but how do I use the same for xml? PFB the code I am using for the same, but it does not work.
JSON post request:
var xmlData = <note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
var config = {
headers: {'Content-Type': 'text/xml'}
};
axios.post('/save', xmlData, config);
Please share if you have any experience with this, TIA.
See Question&Answers more detail:os