title: Mootools: Refused to set unsafe header "Connection"
body: <p>I am trying to send a simple ajax post request using Mootools but I'm only receiving the error message in the title and it seems it doesn't send the data correctly (the request gets canceled).</p>
  
  <p>Here is the html:</p>
  
  <pre><code>&lt;form id="form_5" name="form_5" action="someajaxfile.php" onsubmit="jsfunction(this,5);return false;" method="post"&gt;....&lt;/form&gt;
  </code></pre>
  
  <p>And here is the javascript function called when submitted:</p>
  
  <pre><code>function jsfunction(form,eventId) {
          var container = $('form_contents' + eventId);
  
          form.send({
              update: container,
              evalScripts: true,
              onComplete: function() {
                  container.removeClass('ajax-loading');
              }
          });
  
      }
  </code></pre>
  
  <p>I've tried to add stuff like <code>headers: {'X-Request': 'JSON'},</code> to the send function but nothing seems to change the error. One wierd thing is tho, that in chrome under the network tab I can see two requests:</p>
  
  <pre><code>someajax.php
  /somefolder
  POST
  302
  Found
  text/html
  mootools.js:247
  Script
  354B
  0B
  2ms
  2ms
  2ms0
  
  
  someajax.php
  /somefolder
  GET
  (canceled)
  Pending
  http://localhost:8888/somefolder/someajax.php
  Redirect
  13B
  0B
  0ms
  0.0 days
  </code></pre>
  
  <p>The question is: why can't I send the data, what happens and why and it there any good solution to my problem?</p>