sencha-touchsencha-architectsencha-touch-2.1

How to add header as parameter in ajax call rest web service request in sencha touch


Can anybody tell How to add header as parameter in ajax call rest web service request in sencha touch

Thanks


Solution

  • Here is how you can add header in the sencha touch AJAX call,

    Ext.Ajax.request({
       url: 'myUrl',
    
       headers: {
          "Content-Type": "application/json"
       },
    
       callback: function(options, success, response) {
          console.log(response.responseText);
       }
    });