Response title
This is preview!
While they are not in the jqXhr object, they are in the the settings passed to $.ajax(). That object is merged with the global settings from $.ajaxSetup() and so (probably) has the full list of headers that will be sent. Can that settings object be accessed?You could collect the headers in an array, and add them at the last second before you send the request.
While $.ajaxSetup()
or
direct$.ajax()
calls
pass headers
directly,
a full-proof way to get request headers just before they're sent
would need to take into consideration that headers can be added
via beforeSend
:
jqXHR.setRequestHeader('headerKey', headerValue);
© 2013 jQuery Foundation
Sponsored by and others.