title: setting multiple request headers with jquery ajax
body: <p>This is a bit of a ridiculous question, but how do I set multiple custom http headers in jquery?</p>
  
  <p>This answer: <a href="https://stackoverflow.com/a/14655768/2554598">https://stackoverflow.com/a/14655768/2554598</a>
  explains to do it for one header like:</p>
  
  <pre><code>// Request with custom header
  $.ajax({
     url: 'foo/bar',
     headers: { 'x-my-custom-header': 'some value' }
  });
  </code></pre>
  
  <p>This works. However</p>
  
  <pre><code>// Request with custom header
  $.ajax({
     url: 'foo/bar',
     headers: [{ 'my-first-header': 'blub'}, { 'my-second-header': 'peng'}]
  });
  </code></pre>
  
  <p>This creates a strange empty header field, containing a json array.</p>