Files
insomnia/packages/insomnia-httpsnippet/test/fixtures/output/javascript/xhr/text-plain.js
2018-03-26 13:50:43 -07:00

16 lines
340 B
JavaScript
Executable File

var data = "Hello World";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://mockbin.com/har");
xhr.setRequestHeader("content-type", "text/plain");
xhr.send(data);