JSFiddle - React, Tailwind, and code Playground
by Samuel Guimarães
JavaScript
var data = "json="+JSON.encode({
text: 'some text',
array: [1, 2, 'three'],
object: {
par1: 'another text',
par2: [3, 2, 'one'],
par3: {}
}
}) + "\&delay=3",
xhr = new XMLHttpRequest();
xhr.open('POST', '/echo/json/', true);
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xhr.send(data);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
console.log(xhr.responseText);
}
};