Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

xmlhttp js post request

var xhr = new XMLHttpRequest();
xhr.open("POST", '/url', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.onreadystatechange = function() { // Call a function when the state changes.
    if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
        // Request finished. Do processing here.
    }
}
xhr.send("name=Hello&id=world");
 
PREVIOUS NEXT
Tagged: #xmlhttp #js #post #request
ADD COMMENT
Topic
Name
7+3 =