using xmlhttprequest with POST gives "Unexpected end of input"
<p>I am trying to use xmlhttprequest using POST but it gives me the error "Uncaught SyntaxError: Unexpected end of input " any ideas what I'm doing wrong?</p>

<pre><code>xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
    if (xhr.readyState === 4 &amp;&amp; xhr.status === 200) {
        console.log("saved data!");
    }
}

xhr.open("POST", "http://website.com/login.php", true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send("user=ben&amp;pass=abcxyz");
</code></pre>
