View Full Version : Ext.Ajax.defaultHeaders not sent in requests

4 Jun 2014, 9:33 PM
I am setting a property with a token value to be sent on all Ajax requests (works in 4.2.2). I can see however that this is not being set in the header of the request as expected.

4 Jun 2014, 9:55 PM
Post a code sample please, there's not enough to go on.

4 Jun 2014, 9:59 PM
After successfully signing in to my application, I want to pass a token back to the server on all subsequent requests. This token was provided in the response to the sign-in process.

So in my callback to sign in, i would have the following;

success: function(form, action) {
var obj = Ext.JSON.decode(action.response.responseText);

// ensure all subsequent requests to the server are coupled
// with the token of the current user.
Ext.Ajax.defaultHeaders = {
'X-API-TOKEN': obj.api_token

4 Jun 2014, 10:20 PM
Try Ext.Ajax.setDefaultHeaders();

22 Sep 2014, 5:50 AM
Yup. That works.
Thanks evant