1. #1
    Ext User
    Join Date
    Dec 2009
    Location
    India
    Posts
    2
    Vote Rating
    0
    vivekc is on a distinguished road

      0  

    Default Extjs to call a RESTful webservice

    Extjs to call a RESTful webservice


    Hello,
    I am trying to make a RESTful webservice call using Extjs. Below is the code i am using:

    Code:
      Ext.Ajax.request({ url: incomingURL ,    
        method: 'POST',  
        params: {param1:p1, param2:p2},      
        success: function(responseObject)
          {     var obj = Ext.decode(responseObject.responseText);     
                alert(obj);      },      
        failure: function(responseObject){     
                var obj = Ext.decode(responseObject.responseText);     alert(obj);      }   });
    but it does not work, the request is sent using OPTIONS method instead of POST.
    I also tried to do the same thing using below code but result is the same:


    var conn = new Ext.data.Connection(); conn.request({ url: incomingURL, method: 'POST', params: {param1:p1, param2:p2}, success: function(responseObject) { Ext.Msg.alert('Status', 'success'); }, failure: function(responseObject) { Ext.Msg.alert('Status', 'Failure'); } });


    But when i tried to do the same thing using basic ajax call ( using the browser objects directly i.e. XMLHttpRequest() or ActiveXObject("Microsoft.XMLHTTP")) it works fine and i get the response as expected .


    Can anyone please help me, as i am not able to understand what i am doing wrong with extjs ajax call?

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    http://extjs.com/learn/Ext_Forum_Hel..._code_properly

    Requests usually get changed to OPTION by the Firefox when it thinks you're trying to go cross domain. Is that the case here?

  3. #3
    Ext User
    Join Date
    Dec 2009
    Location
    India
    Posts
    2
    Vote Rating
    0
    vivekc is on a distinguished road

      0  

    Default


    We are trying to make a call between two applications deployed on different servers i.e. abc.mycomp.com makes an ajax call to def.mycomp.com.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."