Files
insomnia/packages/insomnia-httpsnippet/test/fixtures/output/javascript/xhr/text-plain.js
Gregory Schier 4901f03041 Add Prettier
2018-06-25 13:42:50 -04:00

16 lines
339 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);