Results 1 to 2 of 2

Thread: The best way to make requests is..

  1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    39
    Vote Rating
    0
      0  

    Default The best way to make requests is..

    Hi, I am developing a app for mobile with Sencha Touch 2.2 and I need to receive data using a web service requests but I don't know the best way to make it.

    Now I'm using Ajax, but I read that is not correct. It also gives me a problem (OPTIONS http://172.16.0.47/..):

    Sin título.jpg
    Code:
    var parametros ={
            nci: localStorage.getItem("nci"),
            Ticket: localStorage.getItem("guid"),
            TablaClaveiSAT: tabla,
            NumUltimaSinc: timestamp,
            NumRegistroPaginaDesde: 0,
            NumRegistroPaginaHasta: 0
        }
    
    
    Ext.Ajax.request({
            url: "http://172.16.0.47/ClaveiSAT/Service1.svc/SincronizarTabla",
            method: 'GET',
            params: parametros,
            success: function(response) {//SUCCESS LLAMADA
                //Capturo el resultado
                var respuesta = JSON.parse(response.responseText);
                console.log(respuesta);
            },
            failure: function(response) {//ERROR LLAMADA
                //console.log(response);
    
    
            }
    });


    What is the best way to get data from a web service??

    Thank

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

    The OPTIONS request is the browser checking the server that you are trying to send an Ajax request to supports CORS which in this case the server doesn't know how to handle OPTIONS requests.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

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

Tags for this Thread

Posting Permissions

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