[luci] How to communicate with the Json Rpc API

Clemens John clemens-john at gmx.de
Fri Aug 21 20:21:34 CEST 2009


Thanks a lot, this worked!

$sys = new jsonRPCClient('http://ipadress/cgi-bin/luci/rpc/sys?auth='.$token);
$cmd = 'net.devices';
$device_array = $sys->$cmd();
=>Works

$sys = new jsonRPCClient('http://ipadress/cgi-bin/luci/rpc/sys?auth='.$token);
$device_array = $sys->{'net.devices'}();
=>Is the best version I think

Thank you
Clemens

On Friday 21 August 2009 19:47:32 Jo-Philipp Wich wrote:
> Maybe this works?
> 
> $sys = new
> jsonRPCClient('http://ipadress/cgi-bin/luci/rpc/sys?auth='.$token);
> $cmd = "net.devices";
> echo $sys->$cmd()
> 
> Sorry, I have no real clue about php but don't they have some procedural
> interface? Or a low level "magic method" like __get() ?
> 
> ~ JoW
> _______________________________________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/mailman/listinfo/luci


More information about the luci mailing list