title: Fullcalendar 4.x - Adding header "X-Requested-With: XMLHttpRequest"
body: <p>Using Fullcalendar 4.x, is it possible to add the "X-Requested-With: XMLHttpRequest" header when fetching events ?</p>
  
  <p>I'm setting up the event source in this way :</p>
  
  <pre><code>calendar.addEventSource({ url: ev_url, id: 'default' });
  </code></pre>
  
  <p>Everything works and the request is sent correctly, but the header i mentioned is missing (on server side we require that header to be present).</p>
  
  <p>I tried adding the following to addEventSource:</p>
  
  <pre><code>beforeSend: function (xhr) {
    xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
  }
  </code></pre>
  
  <p>Another thing i tried was to add this in the js file (probably pointless since Fullcalendar 4 is not using jquery anymore ?):</p>
  
  <pre><code>$.ajaxSetup({
    beforeSend: function (xhr) {
      xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
    }
  });
  </code></pre>
  
  <p>Unfortunately neither solution worked.</p>
  
  <p>In the past when using fullcalendar 3.x that header was present when requesting events. I guess that was because JQuery was adding it automatically.</p>