Below code simulates a POST request from a JavaScript console:
var xhr = new XMLHttpRequest();
xhr.open('POST','https://mathbostock.execute-api.us-east-1.amazonaws.com/dev/random-items');
xhr.onreadystatechange = function(event) {
console.log(event.target.response);
}
xhr.send();
Practice at:
https://codepen.io
var xhr = new XMLHttpRequest();
xhr.open('POST','https://mathbostock.execute-api.us-east-1.amazonaws.com/dev/random-items');
xhr.onreadystatechange = function(event) {
console.log(event.target.response);
}
xhr.send();
Practice at:
https://codepen.io
No comments:
Post a Comment