title: Valid URL strings for XMLHttpRequest POST request to the current URL
body: <p>In the <code>open()</code> method of <code>XMLHttpRequest</code>, is an empty string for the <code>url</code> parameter valid? Assuming I want to POST a form on the current page to the same page, is:</p>
  
  <pre><code>var request = new XMLHttpRequest();
  request.open('POST', '');
  </code></pre>
  
  <p>...effectively equivalent to:</p>
  
  <pre><code>var request = new XMLHttpRequest();
  request.open('POST', window.location.href);
  </code></pre>
  
  <p>...? Is there any difference between using <code>''</code> and <code>window.location.href</code> for the <code>url</code> parameter, in this case?</p>
  
  <p><a href="https://stackoverflow.com/questions/12955019/default-url-for-xmlhttprequest">This answer</a> says an empty string doesn't work, but doesn't explain why (and it <em>does</em> work through my own experimentation). I can't find a definitive answer in the documentation. </p>