Results 1 to 3 of 3

Thread: Ajax POST to webservice.

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    106
    Answers
    5
    Vote Rating
    5
      0  

    Default Answered: Ajax POST to webservice.

    Hello everyone.
    I need to know how to send a POST to a different server.

    I can't do it with Ajax.request as is a different domain.
    I have a url with some parameters, and the other side needs to receive via POST.

    Thanks,
    Lucas

  2. On the client, JsonP is the only way to do a cross-origin request but it is GET only. To do a POST, you would need a server side script to do it.

  3. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,026
    Answers
    3976
    Vote Rating
    1367
      0  

    Default

    On the client, JsonP is the only way to do a cross-origin request but it is GET only. To do a POST, you would need a server side script to do it.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Doc on how to do so is available here:

    http://docs.sencha.com/touch/2-0/#!/guide/ajax

    As for cross-domain matters, your server-side script should return these http headers:

    Access-Control-Allow-Origin: *
    Access-Control-Allow-Headers: X-Requested-With


    This works for me. I hope it helps!

Posting Permissions

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