title: Adding CSRFToken to Ajax request
body: <p>I need to pass <code>CSRFToken</code> with Ajax based post request but not sure how this can done in a best way.
  Using a platform which internally checking <code>CSRFToken</code> in request (POST request only)</p>
  
  <p>initially I was thinking to add it to header like</p>
  
  <pre><code>$(function() {
      $.ajaxSetup({
          headers : {
              'CSRFToken' : getCSRFTokenValue()
          }
      });
  });
  </code></pre>
  
  <p>Which will make it available to each Ajax request, but it will not work for my case, since in request <code>CSRFToken</code> is still coming as null.</p>
  
  <p>Is there any way I can set <code>CSRFToken</code> for all Ajax call dealing with <code>POST</code> type</p>
  
  <p><strong>Edit</strong>
  If I do something like this in my Ajax call</p>
  
  <pre><code>data: {"newsletter-subscription-email" : "XXX" , 'CSRFToken': getCSRFTokenValue()},
  </code></pre>
  
  <p>Everything is working fine.</p>
  
  <p><em>My Issue is, I want to pass <code>CSRFToken</code> value as a request parameter and not as a request header</em></p>