JSFiddle - React, Tailwind, and code Playground
by Alex
HTML
<pre></pre>
CSS
pre {
padding: 20px;
border-radius: 4px;
font: 14px Consolas, monospace;
tab-size: 4;
background: #111111;
color: #ffffff;
overflow: auto;
}
JavaScript
(async () => {
const output = document.querySelector('pre');
const formData = new FormData();
formData.append('FirstName', 'John');
formData.append('LastName', 'Doe');
const response = await fetch('https://httpbin.org/post', {
method: 'POST',
body: formData
});
const data = await response.json();
output.textContent = JSON.stringify(data, null, '\t');
})();