Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: how to disable Ajax.request method="OPTIONS"

  1. #11
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,640
    Vote Rating
    59
      0  

    Default

    Looks good. And what's in the request that is logged? You do know what the green colour means?
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  2. #12
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,640
    Vote Rating
    59
      1  

    Default

    I miscopied the header. You need

    Code:
    Ext.lib.Ajax.useDefaultXhrHeader = false;
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  3. #13
    Ext JS Premium Member
    Join Date
    Dec 2008
    Posts
    61
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by Animal View Post
    I miscopied the header. You need
    Code:
    Ext.lib.Ajax.useDefaultXhrHeader = false;
    Now it works for normal Ajax request, but not when I add custom headers. Let me give a full example, so you can try it out (assuming you have a gmail/google account somewhere):

    Visit this url to request a temporary security token: AuthSubRequest. The site will ask for permission. If you grant permission, you will be fowarded to Extjs.com?token=sometokenhere. This token is a temporary token that you can exchange for a session token using this request:
    Code:
    Ext.Ajax.request({
    	url:"https://www.google.com/accounts/AuthSubSessionToken", 
    	method: "GET",
    	headers:{'authorization':'AuthSub token="temp_token_here_between_the_quotes"'},
    	success: function(xhr){alert(xhr.responseText)}
    });
    The response for this request should contain a new token, that you can use to access google services. Note that it is important that the authorization header should be exactly in the form AuthSub token="asdf8sdjksdu8ds8g", and you can use every temp token only once.

  4. #14
    Sencha User
    Join Date
    Jan 2012
    Posts
    48
    Vote Rating
    3
      0  

    Default

    Quote Originally Posted by Animal View Post
    I miscopied the header. You need

    Code:
    Ext.lib.Ajax.useDefaultXhrHeader = false;
    Hi,

    I have the same problem with ExtJs 4.1.1a, the store.load() creates an OPTIONS request instead of a GET in Firefox (works fine in IE/Chrome though, sending a GET).
    How can I tell ExtJS to send a proper GET and not OPTIONS in Firefox?

    Thanks,

    $p00ky

  5. #15
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    64
    Vote Rating
    4
      0  

    Default

    Any one got Solution to this problem..?? I am also getting 405 error.....
    .
    In an Ajax call instead of GET, the browser is running OPTION method..
    .
    .
    Any help appreciated.
    Thanks

  6. #16
    Sencha User
    Join Date
    Apr 2011
    Posts
    7
    Vote Rating
    0
      0  

    Default

    i have the same issue. how can we solve it?

  7. #17
    Sencha User
    Join Date
    Oct 2015
    Posts
    1
    Vote Rating
    0
      0  

    Default

    same problem here..

  8. #18
    Sencha Premium User
    Join Date
    Oct 2016
    Posts
    49
    Vote Rating
    1
      0  

    Default

    same here...

    Request Method: OPTIONS on chrome

    on Proxy config:

    Code:
    useDefaultXhrHeader: false,
    fix the issue

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •