javascript - Submit payload data as a non json format with Ext.ajax.Request -
i want submit data using ext.ajax.request
, payload being sent in json format:
{name: 'john gold', id:1, company:'abcde'}
but, want submit payload in simple format:
name=john+gold&id=1&company=abcde
how can achieve ?
my method looks like:
ext.ajax.request({ url: url, method: 'post', params: payload, success: function(response) { var data = ext.decode(response.responsetext).data; console.log("search data : *** \n" + data); this.fireevent("aftersubmit", params, data); }, scope: });
use method: 'get'
if want params in url.
update
you'll got convert payload then... ext.ajax#request
accepts string params option, , "url encode" data object ext.object.toquerystring
. that:
ext.ajax.request({ // ... method: 'post', params: ext.object.toquerystring(payload) });
Comments
Post a Comment