debug on remotecontrol

  • nicola_86
  • nicola_86's Avatar Topic Author
  • Visitor
  • Visitor
4 years 4 months ago #97619 by nicola_86
nicola_86 created the topic: debug on remotecontrol
Hi,
I'd like to see the parameters that arrive within my json call. Is it possible through some prints in some point of the file remotecontrol.php? I was trying to understand reading the file and doing some test.
Any help would be appreciate.
thanks

Please Log in to join the conversation.

More
4 years 4 months ago #97620 by mdekker
mdekker replied the topic: debug on remotecontrol
When you use json, go to application\libraries\LSjsonRPCServer.php. In the very beginning line 24 your json reuqest will be converted to a request. If you output that you will see what you have. When you get no response on remotecontrol most probably the json_decode fails due to incorrect json string. We should be able to trap that in the future and deliver a nice error.

---
Menno Dekker
The following user(s) said Thank You: nicola_86

Please Log in to join the conversation.

  • nicola_86
  • nicola_86's Avatar Topic Author
  • Visitor
  • Visitor
4 years 4 months ago #97633 by nicola_86
nicola_86 replied the topic: debug on remotecontrol
thanks for the suggestion, it works. :)
however with request with a wrong json sintaxt it's better to put the print before decoding it
I had a good result doing that:

// reads the input data
print_r(file_get_contents('php://input'));
$request = json_decode(file_get_contents('php://input'),true);
print_r("request: ");
print_r($request);

Thanks a lot!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!