[luci] Help wtih JSON-RPC interface?

Johnny Turpin jturpin at industrynext.com
Di Sep 30 23:32:13 CEST 2008


I am trying to get a simple test running with the LuCI JSON-RPC interface.

Should I be able to use the JSON-RPC interface on the test LuCI server (the one that runs when you use "make runhttpd")? 
I do not seem to be getting any kind of reasonable response when using the test host server.

I do get a response when using the rpc server on a Kamikazi box - but I am getting a weird response message that looks like this:

--------------------------
HTTP/1.0 200 OK
Content-Type: application/json
Cache-Control: no-cache
Expires: 0

{"id":null,"error":{"message":"Parse error.","code":-32700},"jsonrpc":"2.0"}
--------------------------

here is my simple page which simply tries to login and get an auth code:


-----------------------------------------------------------
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>JSON Test</title>
	<script type="text/javascript" src="js/jsonrpc.js"></script>
	
	<script>
	load = function()
	{
		jsonrpc = new JSONRpcClient("/cgi-bin/luci/rpc/auth");
		var result = jsonrpc.login("root", "password");
		alert(result);
	}
	</script>
</head>
<body onload="load();">
	<div>Auth Test</div>
</body>
</html>
-----------------------------------------------------------

The javacript JSON-RPC client library I am using is from jabsorb and can be found here:

http://jabsorb.org/FrontPage



Are there any other JSON-RPC javascript libraries that have been tested with LuCI?

Thanks much...

-jt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.subsignal.org/pipermail/luci/attachments/20080930/9306fab1/attachment.htm 


More information about the luci mailing list