title: Headers in post request with Backbone.js
body: <p>I want to put a headers in a post request to my REST service with Backbone.js , I try two ways :</p>
  
  <pre><code>this.model.save( { headers: {'X-Token' : myToken } } );
  </code></pre>
  
  <p>and with a setResquestHeader :</p>
  
  <p>the function :</p>
  
  <pre><code>sendToken: function (xhr) {
          var tokenCookie;
  
          var name = "xtoken" + "=";
          var ca = document.cookie.split(';');
          for(var i=0; i&lt;ca.length; i++) 
          {
              var c = ca[i].trim();
              if (c.indexOf(name)==0) tokenCookie = c.substring(name.length,c.length);
          }
            xhr.setRequestHeader('X-Token', tokenCookie);
          }
  </code></pre>
  
  <p>the call :</p>
  
  <pre><code>this.model.save({ 
                  beforeSend: this.sendToken,
  
                  success: function() {
  
                      alert("success");
                  },
                  error: function(model,response,options) {
                      alert("error");
  
                  }
  
              });     
  </code></pre>
  
  <p>But it doesn't seem to work , it doesn't send the header</p>