2011-01-05, 14:31
I'm having a lot of trouble doing a simple rpc call with mootools javascript. Hopefully someone can shed some light.
This is my basic request:
It errors out with a parse error, so something must be malformed, but i can't figure out what. I've tried with and without params, putting them in an array and whatnot, but i keep getting the same result.
Any ideas?
This is my basic request:
Code:
jsonRequest = new Request.JSON(
{
'url': '/jsonrpc',
}).post(
{
'jsonrpc': '2.0',
'method': 'Files.GetSources',
'id': 1,
'params':
{
'media': 'video'
}
});
It errors out with a parse error, so something must be malformed, but i can't figure out what. I've tried with and without params, putting them in an array and whatnot, but i keep getting the same result.
Any ideas?