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 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,551
    Answers
    3931
    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! Checkout the CODE tag!

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

  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
  •