title: How to set multiple headers data with XMLHttpRequest in async mode?
body: <p>My api call requires me to pass the api key in the headers, but I'm getting error back from the api service <code>{"error":"2424452","message":"Invalid Api Key"}</code></p>
  
  <p>I know my api key is valid as I can make the same api call in Python just fine, example:</p>
  
  <pre><code>req = requests.Session()
  req.headers.update({'x-api-key': 'my-api-key', 'X-Product': 'my-product-name'})
  req.get(url)
  </code></pre>
  
  <p>But in javscript, the same call errors out. I believe I'm not setting the headers correctly or something?</p>
  
  <pre><code>var req = new XMLHttpRequest();
  req.onreadystatechange=handleStateChange;
  req.open("GET", "url", true);
  req.setRequestHeader("Host", "api.domain.com", "x-api-key", "my-api-key", "X-Product", "my-product-name");
  req.send();
  </code></pre>
  
  <ul>
  <li>This <code>XMLHttpRequest</code> is not a browser call, rather in an application that support <code>XMLHttpRequest</code>.</li>
  </ul>