JSON-RPC over HTTP?
#17
Hi!
I need to develop a custom interface with Flash and actionscript 2 (not AS3), but I am not able to figure it out how to send the json request to xbmc.

With loadVars.load() I can open an http connection to the server and, if the server need no other parameter, i can receive the json string and cast it into my object.
XBMC server needs to receive a json object with the call to obtain an answer.

With loadVars.sendAndLoad() I can send variables to the server in post mode, but I need to know the variable name that the xbmc server is expecting from my client.
All your examples stream the string (byte array) directly to the server immediately after opening a connection, but no variable name is specified.

Following you can see the 2 ways i tryed yet, obtaining only a -32700 parse error message, someone can help me with this?

Code:
var snd:LoadVars = new LoadVars();
var rcv:LoadVars = new LoadVars();

rcv.onData = function(thedata) { trace("Data Received: " + thedata); }

snd.jsonrpc = '{"jsonrpc": "2.0", "method": "JSONRPC.Introspect", "id": "1"}'
snd.sendAndLoad("http://xbmc.ip.address/jsonrpc", rcv, "POST");
and
Code:
var snd:LoadVars = new LoadVars();
var rcv:LoadVars = new LoadVars();

rcv.onData = function(thedata) { trace("Data Received: " + thedata); }

snd.jsonrpc = "2.0";
snd.method = "JSONRPC.Introspect";
snd.id = "1";
snd.sendAndLoad("http://xbmc.ip.address/jsonrpc", rcv, "POST");

I'am not able to use the tcp socket because AS2 needs a null char to terminate the string transmision and xbmc seems not sending a null char at the endo of the json strings.

Sorry for bad English!

Please help.

Thank you.

Bye!
Reply


Messages In This Thread
JSON-RPC over HTTP? - by bradvido88 - 2010-12-20, 17:24
[No subject] - by _Andy_ - 2010-12-20, 17:59
[No subject] - by darkscout - 2010-12-20, 18:01
[No subject] - by bradvido88 - 2010-12-20, 18:17
[No subject] - by bradvido88 - 2010-12-20, 19:16
[No subject] - by Montellese - 2010-12-20, 20:42
[No subject] - by bradvido88 - 2010-12-20, 20:49
[No subject] - by darkscout - 2010-12-20, 21:51
[No subject] - by bradvido88 - 2010-12-20, 21:52
[No subject] - by plumser - 2010-12-21, 19:49
[No subject] - by Adam - 2011-01-01, 04:57
[No subject] - by Montellese - 2011-01-01, 11:46
[No subject] - by toenuff - 2011-01-04, 05:26
[No subject] - by toenuff - 2011-01-04, 05:45
[No subject] - by manxam - 2011-01-05, 09:17
[No subject] - by Montellese - 2011-01-05, 10:48
Actionscript 2.0 - by TheyKilledKenny - 2011-01-07, 13:18
[No subject] - by Montellese - 2011-01-07, 14:08
[No subject] - by TheyKilledKenny - 2011-01-07, 18:41
[No subject] - by Montellese - 2011-01-07, 20:27
[No subject] - by ArcticGiraffe - 2011-08-13, 02:08
[No subject] - by topfs2 - 2011-08-13, 10:40
[No subject] - by ArcticGiraffe - 2011-08-13, 15:32
[No subject] - by topfs2 - 2011-08-13, 18:48
[No subject] - by ArcticGiraffe - 2011-08-13, 19:27
RE: JSON-RPC over HTTP? - by Richard6360 - 2016-05-22, 11:38
Logout Mark Read Team Forum Stats Members Help
JSON-RPC over HTTP?1