I'm calling a .net webmehod using MooTools and it works fine, as long
as I do not send data with. As soon as I add a key:value pair it fails
to load the webmethod :
var showRoles = new Request.JSON({
url: 'default.aspx/getRoles',
method: 'post',
evalResponse: true,
urlEncoded: false,
headers: { 'Content-Type': 'application/json; charset=utf-8' },
data: {'id': '10'},
onSuccess: function(json) {
loadRoles(json.d); //--- Method that generates a table.
},
}).send();
urlEncoded must be set to false and headers set to { 'Content-Type':
'application/json; charset=utf-8' }
When i add the data: { 'id':'10' } it shows up in firebug as id=10
instead of id 10 as supposed when I use post and not get.
Can some one help me on this matter ?