I am trying to execute POST XML via JavaScript in a REST API.
The request data is as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<EditGame xmlns="http://blahblahblah.com" >
<playerCount>2</playerCount>
<score>2621440</score>
</EditGame>
How to determine postString above if my code looks like this:
xhr.open('POST',URLgameUpdateAction);
xhr.setRequestHeader('Content-type','application/x-www.form-urlencoded');
xhr.send(**postString**);
Hope this makes sense.
source
share