title: beforeSend does not add authorization header to my jquery ajax call (basic authorization)
body: <p>I have been trying to make an $ajax() call to a rest service. I need to use basic authentication to make this call, so i added the beforeSend handler to my ajax call. When I trace this in Fiddler, I dont see it attaching the authorization header to my request.</p>
  
  <pre><code>&lt;body&gt;
  &lt;div id="Button1" style="border: 2px solid blue; font-family: Cambria;"&gt;
      Get CMS Content
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;div id="error" style="color: Red; font-family: Cambria; font-size: large; display: none;"&gt;
  &lt;/div&gt;
  &lt;span style="font-family: Cambria; color: #009933; font-weight: bold"&gt;Result:&lt;/span&gt;
  &lt;div id="result"&gt;
  &lt;/div&gt;
  &lt;script src="scripts/jquery-1.8.3.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $('#Button1').click(function () {
              $('#error').fadeOut('slow');
              //var requestParams = { 'format': 'json', 'username': 'administrator', 'password': '' };
              var requestParams = { 'format': 'json' };
              $.ajax({
                  beforeSend: function (xhr) {
                      xhr.setRequestHeader("Authorization", "Basic YWRtaW5pc3RyYXRvcjo=");
                  },
                  url: "http://localhost/KenticoCMS7/rest/cms.country",
                  data: requestParams,
                  dataType: "text",
                  contentType: "application/json;",
                  success: function (result) {
                      $('#error').fadeOut('slow');
                      $('#result').text(result);
                  },
                  error: function (xhr, status, errorThrown) {
                      $('#error').text(JSON.stringify(xhr));
                      $('#error').fadeIn('slow');
                  }
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Suggestions around this would be of great help. Also, can some one comment on, why fiddler traces this request as a OPTIONS type when it should be of GET type?</p>