POST
<script async src="//jsfiddle.net/taylorkelley/e6L4s7bv/1/embed/html,css,result/"></script>
HAML
%script{src: "https://cdnjs.cloudflare.com/ajax/libs/mootools/1.6.0/mootools-core.min.js"}
%script{src: "https://cdnjs.cloudflare.com/ajax/libs/mootools-more/1.6.0/mootools-more-compressed.js"}
<h3>HTML:</h3>
<p id="result"></p>
CSS
p {
padding: 10px;
}
p {
margin: 5px;
border: 1px dotted #999;
}
TypeScript
("/og/html/", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"
},
body: "html=<a href='#'>hello world</a>"
})
.then((response) => response.text())
.then((responseText) => {
document.querySelector("#result").innerHTML = responseText
})
.catch((error) => {
console.error(error)
})