OPTIONS 405 Not Allowed, even with Chrome App extension

3 posts, 1 answers
  1. Raul Arturo
    Raul Arturo avatar
    2 posts
    Member since:
    May 2015

    Posted 04 Jun 2015 Link to this post


     I've been trying to solve this problem for days, but can't. I'm trying to do an hybrid app, using jQuery AJAX POST requests to an external service. But no matter what I do, I keep receiving a "OPTIONS http://xxxx 405 (Method Not Allowed)". I installed the Chrome App extension for Telerik, but the error just don't go away. If I try the same data sent to the service in the Rest Console Chrome App, it works perfectly. It even works great as a packaged Chrome App, but can't make it work on the Telerik AppBuilder iPhone simulator on Chrome. This is my AJAX code:


        url : defaultURL + metodo,
        type: "POST",
        contentType : "application/json",
    success(function (data){
       callback (null, data);
    error(function (data){
       callback (data, null);


    I've tried to send crossDomain request, tried to send the data with JSON.stringify, but nothing. And what I receive in the chrome dev console is this:

    OPTIONS http://xxxxxxxx 405 (Method Not Allowed)

    XMLHttpRequest cannot load http://xxxxxxx. Invalid HTTP status code 405 

    {readyState: 0, status: 0, statusText: "error"}


    BTW: I can't modify the external service, it is from a third party and not available for me.

    Any suggestions? I really like the Telerik AppBuilder in the cloud, but I'm starting to get desperate and even thinking in returning to the Chrome packaged App if I can solve this problem :(

  2. Answer
    Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 09 Jun 2015 Link to this post

    Hello Raul,

    The In-Browser AppBuilder Device Simulator is making requests from the client's browser and it is therefore a subject to CORS. This means that CORS should be enabled on the requested server and specifically, the requested server should return a CORS header that informs the client's browser that it allows it to make requests.

    During the preflight OPTIONS request, you should see the following two headers: Access-Control-Request-Method and Access-Control-Request-Headers. These request headers are asking the server for permissions to make the actual request. Your preflight response needs to acknowledge these headers in order for the actual request to work. In case the server is not configured to accept this request method, it will respond with a "405 Method Not Allowed". As a result the Chrome App CORS extension cannot add the Access-Control-Allow-Origin header and the error you posted will be received when working with the device simulator in the browser.

    Since you cannot modify the server to add the Access-Control-Allow-Origin header in its configuration, you can try sending a GET request. GET might be enabled as a type and it might be worth checking. Alternatively you can try the Windows client of AppBuilder or the Command-Line Interface. Both provide a device simulator which is not running inside the browser and you should not have CORS issues.

    Tina Stancheva

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

  3. Raul Arturo
    Raul Arturo avatar
    2 posts
    Member since:
    May 2015

    Posted 12 Jun 2015 in reply to Tina Stancheva Link to this post

    I ended up using the command line, because I don't have windows, I use linux and osx, and the command line was pretty good after doing some examples. Thanks!
Back to Top