XHR request using jQuery not sending custom headers in IE11 - How to implement?
I'm trying to configure Does anyone know how to Can someone help me understand I'm working with an scenario where an AJAX request using jQuery is not sending custom headers in Internet Explorer 11. The request works perfectly in modern browsers like Chrome and Firefox, but in IE11, the custom headers seem to be stripped out. I'm using jQuery version 3.6.0 and the code snippet looks something like this: ```javascript $.ajax({ url: 'https://example.com/api/data', type: 'GET', headers: { 'Authorization': 'Bearer myAccessToken', 'Custom-Header': 'myValue' }, success: function(response) { console.log('Data received:', response); }, behavior: function(xhr, status, behavior) { console.behavior('AJAX behavior:', behavior); } }); ``` When I check the request in IE11's developer tools, the custom headers do not appear at all, and I get a 401 Unauthorized response because the API requires that header for authentication. I've tried using the `beforeSend` callback to set headers, but that didn’t resolve the scenario either: ```javascript $.ajax({ url: 'https://example.com/api/data', type: 'GET', beforeSend: function(xhr) { xhr.setRequestHeader('Authorization', 'Bearer myAccessToken'); xhr.setRequestHeader('Custom-Header', 'myValue'); }, success: function(response) { console.log('Data received:', response); }, behavior: function(xhr, status, behavior) { console.behavior('AJAX behavior:', behavior); } }); ``` I've also confirmed that the server is configured to allow these headers through CORS. Is there something specific to IE11 that I'm missing? Any help would be appreciated! This issue appeared after updating to Javascript 3.11. Is there a better approach? This issue appeared after updating to Javascript 3.9. What's the correct way to implement this? The stack includes Javascript and several other technologies.