PDA

View Full Version : CORS Support on Android



PaulKish
21 Jul 2012, 12:27 PM
I have been able to implement CORS request in my touch application, I have also configured the server appropriately, this set-up works on my test environment on Chrome 20.0.1132.57 m, however it seems not to work on android webkit browser 2.3.x though according to this (http://caniuse.com/cors) it should work. My config for the ajax request is

Ext.Ajax.request({
url: 'http://url/',
form: 'formid',
withCredentials: false,
useDefaultXhrHeader: false,
my .htaccess file looks like this

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Credentials "false"
Header set Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
Header set Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Alternatively if i would like to know how to submit a form via jsonp. Thanks in advance

mitchellsimoens
23 Jul 2012, 4:22 AM
You should try using a remote debugger to see the requests so you can see what's going on.

The form will always use Ajax request unless you override the form panel via extending.

PaulKish
23 Jul 2012, 5:05 AM
Very interesting suggestion, I have been able to use the default form submit and it works, had to tweak the server response to return a json with success message, I am curious about a remote debugger any suggestions that I can use?

mitchellsimoens
23 Jul 2012, 5:16 AM
Something like weinre

PaulKish
23 Jul 2012, 5:33 AM
Cool thanks, I have stumbled across RemoteJS from Sencha, does it work on Android 2.3.x, is it still supported?