-
29 Mar 2010 1:41 PM #1
how to disable Ajax.request method="OPTIONS"
how to disable Ajax.request method="OPTIONS"
I use an Ajax request to download xml data from Google's Spreadsheet API. The Google server only allows 'GET' requests. However, for some reason when I create an Ext.Ajax.request to an external url (i.e. one that starts with http://), Ext uses method "OPTIONS" instead of "GET", resulting in a 405 method denied from Google. Even when explicitly method: "GET" is set in the Ajax.request config, it still uses method OPTIONS. How do I prevent this?
Code:Ext.Ajax.request({ url: 'http://www.google.com', method: "GET" });
-
29 Mar 2010 2:53 PM #2
We need a code example. Can you make the smallest possible code example that demonstrates the problem and post it on the forums?
-
29 Mar 2010 3:13 PM #3
-
29 Mar 2010 3:48 PM #4
http://www.checkupdown.com/status/E405.htmlSo 405 errors can arise because the Web server is not configured to take data from the client at all. They can also arise if the client does not have sufficient authority to the particular URL resource identified on the request.
-
29 Mar 2010 3:58 PM #5
@jeroenooms --
Firefox generates on HTTP option verb when it thinks you are attempting a cross-domain request.
Altho Firefox supports such a request, Googles servers do not respond with the necessary 'Allow-Origin' headers for you to succeed. Google up on 'same-origin' requests.
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
30 Mar 2010 4:25 AM #6
@hendricd
so, any idea how to fix this? Or is it just impossible to do cross-domain requests to google services with firefox? That can't be the case because there are many other 3rd party google service apps, that work in FF...
-
30 Mar 2010 4:28 AM #7
Try
Even if a server does accept x-domain, I have found that the X-Requested-With header breaks it.Code:Ext.lib.Ajax.useDefaultHeader = false;
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
30 Mar 2010 4:37 AM #8
Also , use disableCaching: false
I at least get a response from the server:
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
30 Mar 2010 4:43 AM #9
-
30 Mar 2010 5:18 AM #10


Reply With Quote




Still 405.