Ajax Authorization Request headers fails again and again
问题 I'm working on a consumer for a self-made API and having serious difficulties with setting the Authorization header . I am using JQuery for the Ajax requests, but the 'beforeSend' does not work at all (using fiddler to examine the requests) This is my beforeSend code: $.ajax({ type: "GET", url: url+"/Projects", contentType: "application/json; charset=utf-8", beforeSend: function (req) { req.setRequestHeader("Authorization", AuthBuilder(username, password)); }, success: function (result) {