Results 1 to 3 of 3

Thread: How to send an HTTP POST request with request body content

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    7
    Vote Rating
    0
      0  

    Question Unanswered: How to send an HTTP POST request with request body content

    Hi,

    I'm new to Sencha touch and ExtJS and I'd like to send an HTTP POST request with some content in the request body (something like param1=value1&param2=value2). As far as I understand I'm supposed to use a writer but I really have no idea how to do that.

    Here's my code :

    app.stores.records = new Ext.data.Store({
    model: "app.models.Record",
    autoLoad:true,
    proxy: {
    type: 'ajax',
    url : 'http://hostname/mywebservice.aspx',
    method : 'POST',
    reader: {
    type: 'xml',
    record: 'RECORD'
    },
    headers: {
    'Content-type': 'application/x-www-form-urlencoded',
    'Host': 'hostname',
    'User-Agent': 'useragent',
    'Accept': '*/*'
    },
    writer: {
    ?????????
    }
    }
    });

    Cheers,

    Pierre

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

    Default

    http://docs.sencha.com/touch/1-1/#!/...data.XmlWriter

    Code:
    proxy : {
        type : 'ajax',
        url : 'someUrl.xml',
        reader : {
            type : 'xml'
        },
        writer : {
            type : 'xml'
        }
    }
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    http://docs.sencha.com/touch/1-1/#!/api/Ext.data.XmlWriter

    Code:
    proxy : {
        type : 'ajax',
        url : 'someUrl.xml',
        reader : {
            type : 'xml'
        },
        writer : {
            type : 'xml'
        }
    }
    Thanks for the reply but I still don't see how to use a writer to put some content in my POST request body. I just want to pass a few params : param1=value1&param2=value2

    Cheers,

    Pierre

Posting Permissions

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