How can I view the result of a script (result of a calculation) as JSON via RESTfm?
Are there any best practices in this regard?
Or is it possible to do this via the FileMaker PHP API?
With RestFM, a script doesn't return results, however we've gotten around that by having the script write its "return" result into a global field that is on the layout that the script ends on. The fields on that layout are returned (for a single record), so by including the global field on the layout, you can pull out its contents. The formatting of the data in the global field I don't think matters; we've returned strings and lists of strings from our scripts, and in other restFM get record calls, we've pulled out fields holding JSON data.
Apologies if I have misunderstood your question.
I am not certain to perfectly answer your question, nevertheless, I am using two tools to check my scripts and calculations. 1) Application named Fiddler ( Fiddler - Free Web Debugging Proxy - Telerik ) which intercept any outgoing or incoming http or hhps packets and tell you a bunch of things. It is capable of deciphering on the fly username and password, all headers, and data, very useful. When I was learning JSON, I always used JSON Editor Online - view, edit and format JSON online self explanatory.
Retrieving data ...