-
28 Mar 2012 7:36 PM #1
useDefaultXhrHeader option not working for Ext.Ajax.request calls
useDefaultXhrHeader option not working for Ext.Ajax.request calls
It does not appear that the useDefaultXhrHeader option is working for Ext.Ajax.request calls. I looked at the current source for this function in Sencha Touch 2 (http://docs.sencha.com/touch/2-0/sou...method-request) and there does not appear to be any explicit reference to this parameter, even though it is referenced in the Ajax tutorial for making CORS calls (http://docs.sencha.com/touch/2-0/#!/guide/ajax). I looked at the Source for this same function in Sencha Touch 1.1 and there is explicit mention of the parameter:
if (me.useDefaultXhrHeader && !headers['X-Requested-With']) { headers['X-Requested-With'] = me.defaultXhrHeader; }
I am trying to make a CORS request to a server that I do not have control over, and this server does not accept the 'X-Requested-With' header parameter, so I would like to remove it from the request. Thanks guys.
-
28 Mar 2012 8:10 PM #2
I just determined that if I call the setter function for this parameter, it works.
So using Ext.Ajax.setUseDefaultXhrHeader() works to set the parameter to true or false. However, it still does not work as it was described in the tutorial.
-
29 Mar 2012 7:34 AM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
We'll get that fixed in the documentation. Thank you for the report.
-
29 Mar 2012 8:09 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
Hi budoudoh,
I've updated the request method to also support the useDefaultXhrHeader option being passed in. Also added documentation for the setter and getter methods on Ext.Ajax itself.
Thanks for the report.
-
15 Apr 2013 5:27 AM #5Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
The Ajax proxy now also has this configuration to allow Ajax proxies to request data cross domain.
-
3 May 2013 4:50 AM #6
Does this feature available in ST 2.1?
Does this feature available in ST 2.1?
Does this feature available in ST 2.1?
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2625
in
2.0.


Reply With Quote
