Hybrid View

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    8
    Vote Rating
    0
    ajaygoyal88 is on a distinguished road

      0  

    Default 405 . Method not allowed.

    405 . Method not allowed.


    Whenever I tried to call the web service using Ext.Ajax.Request with method type as POST , it automatically changes it to OPTIONS and following error is occrued :-


    405. That’s an error.The request method OPTIONS is inappropriate for the URL /maps.

    Can anybody help me to tell why it's method type is automatically changes to OPTIONS but i m giving it as POST.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,085
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Are you loading cross domain? The browser has to send an OPTIONS request to check if the server supports CORS.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    8
    Vote Rating
    0
    ajaygoyal88 is on a distinguished road

      0  

    Default 405. Method not Allowed.

    405. Method not Allowed.


    Thanks for the reply Michell.
    I am try to call the google maps service with Ext.Ajax.Request.
    The code which i use to call the service is:-

    Ext.Ajax.request({
    url : 'http://www.google.com/maps',
    method:'GET',
    params: {
    q: 'restaurant',
    sll: '23.00,72.00',
    radius:'2000',
    output:'json'
    },
    callback: function(response){
    if(response && response.responseText){
    alert('hello');
    console.log(response.responseText);
    }
    },
    });

    Whenever I call this , the following error is occured in the console of chrome :-
    [/COLOR]
    [COLOR=red !important]XMLHttpRequest cannot load http://www.google.com/maps?_dc=13499...00&output=json. Origin null is not allowed by Access-Control-Allow-Origin.
    [/COLOR]


    Please tell me the problem where I went wrong.