1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    4
    Vote Rating
    0
    sonianand11 is on a distinguished road

      0  

    Smile POST request in Sencha Touch using Ajax

    POST request in Sencha Touch using Ajax


    HI, I am trying to make a POST request using Ajax in sencha touch. my problem is when I am sending request my server accepts it as OPTIONS request. my code is :

    var post_json = { usrname: username, password: password } ;

    Ext.Ajax.request({
    url: 'http://localhost:3000/',
    method: "POST",
    params: {
    user_session: post_json
    },
    success: function(){
    alert("sucessful");

    },
    failure: function(){
    alert("fail");
    }

    });

    How can i solve this problem?

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    maybe: user_session: Ext.util.JSON.encode(post_json)

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    26
    Vote Rating
    1
    danmux is on a distinguished road

      0  

    Default


    I think you are seeing the pre-flight OPTIONS request when Cross-Origin Resource Sharing or cross site scripting...

    http://www.w3.org/TR/cors/

    I suspect your web page serving the JS is not on port 3000 - but your Ajax call is...

    on mac - try...

    open -a '/Applications/Safari.app' --args --disable-web-security

    I cant get this to work, though others have..
    This works for me on Chrome...

    open -a '/Applications/Google Chrome.app' --args --disable-web-security

  4. #4
    Sencha User
    Join Date
    May 2012
    Posts
    4
    Vote Rating
    0
    zeroprg is on a distinguished road

      0  

    Default How to specify/wire Ajax.request in IDE Sencha Architect 2 ?

    How to specify/wire Ajax.request in IDE Sencha Architect 2 ?


    I tried to find EXT.Ajax object in Architect but failed. How to wire Ajax.request to AjaxProxy or other visual object. I want to make Ajax.request in Sencha Architect 2.

Similar Threads

  1. I'm confused about GET and POST in Sencha-touch
    By pcr in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 19 Jul 2011, 4:44 AM
  2. To post a request from Ext-js to Ajax with running example
    By dinkar in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 28 Mar 2011, 10:14 PM
  3. Request: A Simple Sencha Touch App's Source
    By tmanderson in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 27 Mar 2011, 3:13 PM
  4. How to load data to multiple stores with one request in Sencha Touch?
    By Nicodemuz in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 23 Mar 2011, 1:51 AM
  5. Not allowed to post on sencha touch forum without license?
    By pokiekokie in forum Community Discussion
    Replies: 1
    Last Post: 3 Feb 2011, 9:45 AM

Thread Participants: 3

Tags for this Thread