title: $.ajaxPrefilter overwrites request body
body: <p>I wanted to add a csrf token to all request bodies for ajax requests.
  i found the following post useful: <a href="https://stackoverflow.com/questions/28417781/jquery-add-csrf-token-to-all-post-requests-data/28418032?noredirect=1#comment55770583_28418032">jQuery add CSRF token to all $.post() requests&#39; data</a></p>
  
  <pre><code>$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
      options.data = $.param($.extend(originalOptions.data, { c: csrf }));
  });
  </code></pre>
  
  <p>For some reason, this ovewrites the request body. i do not understand why. i can see when i serialize the request body its all there, but when it submits the body only contains the <code>c</code> field. It may be helpful to note that i am creating the form data using jQuery's <code>serialize()</code> method.</p>